From 4ea3a05f5557c3ecfe809122e2f1c9dcb86fb555 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Tue, 17 Sep 2024 13:44:16 +1200 Subject: [PATCH] API Use new names for renamed classes --- docs/en/index.md | 2 +- .../GridFieldDetailFormItemRequestExtension.php | 2 +- src/GridFieldAddExistingSearchButton.php | 4 ++-- src/GridFieldAddExistingSearchHandler.php | 2 +- src/GridFieldAddNewInlineButton.php | 4 ++-- src/GridFieldAddNewMultiClass.php | 2 +- src/GridFieldConfigurablePaginator.php | 8 ++++---- src/GridFieldEditableColumns.php | 2 +- src/GridFieldExternalLink.php | 2 +- src/GridFieldNestedForm.php | 12 ++++++------ src/GridFieldNestedFormItemRequest.php | 4 ++-- src/GridFieldOrderableRows.php | 8 ++++---- src/GridFieldRequestHandler.php | 2 +- src/GridFieldTitleHeader.php | 4 ++-- tests/GridFieldConfigurablePaginatorTest.php | 2 +- tests/GridFieldNestedFormTest.php | 2 +- tests/GridFieldOrderableRowsTest.php | 2 +- 17 files changed, 32 insertions(+), 32 deletions(-) diff --git a/docs/en/index.md b/docs/en/index.md index 4950ebd..c7015d4 100644 --- a/docs/en/index.md +++ b/docs/en/index.md @@ -335,7 +335,7 @@ There is also the possibility to use Nested GridField with the data structure Ar namespace App\Models; use MyDataObject; -use SilverStripe\ORM\ArrayList; +use SilverStripe\Model\List\ArrayList; use SilverStripe\ORM\DataObject; class MyDataSet extends DataObject diff --git a/src/Extensions/GridFieldDetailFormItemRequestExtension.php b/src/Extensions/GridFieldDetailFormItemRequestExtension.php index e32f2a5..8cce7b8 100644 --- a/src/Extensions/GridFieldDetailFormItemRequestExtension.php +++ b/src/Extensions/GridFieldDetailFormItemRequestExtension.php @@ -8,7 +8,7 @@ use SilverStripe\Forms\FieldList; use SilverStripe\Forms\GridField\GridFieldDetailForm_ItemRequest as CoreGridFieldDetailForm_ItemRequest; use SilverStripe\Forms\LiteralField; -use SilverStripe\View\ArrayData; +use SilverStripe\Model\ArrayData; use SilverStripe\View\HTML; use Symbiote\GridFieldExtensions\GridFieldAddNewMultiClass; use Symbiote\GridFieldExtensions\GridFieldExtensions; diff --git a/src/GridFieldAddExistingSearchButton.php b/src/GridFieldAddExistingSearchButton.php index a8a3970..f05e878 100755 --- a/src/GridFieldAddExistingSearchButton.php +++ b/src/GridFieldAddExistingSearchButton.php @@ -5,8 +5,8 @@ use SilverStripe\Forms\GridField\AbstractGridFieldComponent; use SilverStripe\Forms\GridField\GridField_HTMLProvider; use SilverStripe\Forms\GridField\GridField_URLHandler; -use SilverStripe\ORM\SS_List; -use SilverStripe\View\ArrayData; +use SilverStripe\Model\List\SS_List; +use SilverStripe\Model\ArrayData; /** * A modal search dialog which uses search context to search for and add diff --git a/src/GridFieldAddExistingSearchHandler.php b/src/GridFieldAddExistingSearchHandler.php index 4e02f7d..ccc9e26 100644 --- a/src/GridFieldAddExistingSearchHandler.php +++ b/src/GridFieldAddExistingSearchHandler.php @@ -9,7 +9,7 @@ use SilverStripe\Forms\FormAction; use SilverStripe\Forms\GridField\GridField; use SilverStripe\ORM\DataList; -use SilverStripe\ORM\PaginatedList; +use SilverStripe\Model\List\PaginatedList; use SilverStripe\ORM\Search\SearchContext; /** diff --git a/src/GridFieldAddNewInlineButton.php b/src/GridFieldAddNewInlineButton.php index 4983d2c..086b986 100755 --- a/src/GridFieldAddNewInlineButton.php +++ b/src/GridFieldAddNewInlineButton.php @@ -9,13 +9,13 @@ use SilverStripe\Forms\GridField\GridField; use SilverStripe\Forms\GridField\GridField_HTMLProvider; use SilverStripe\Forms\GridField\GridField_SaveHandler; -use SilverStripe\ORM\ArrayList; +use SilverStripe\Model\List\ArrayList; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObjectInterface; use SilverStripe\ORM\FieldType\DBField; use SilverStripe\ORM\ManyManyList; use SilverStripe\ORM\ManyManyThroughList; -use SilverStripe\View\ArrayData; +use SilverStripe\Model\ArrayData; use SilverStripe\View\Requirements; use Exception; diff --git a/src/GridFieldAddNewMultiClass.php b/src/GridFieldAddNewMultiClass.php index 95a3e05..913464e 100755 --- a/src/GridFieldAddNewMultiClass.php +++ b/src/GridFieldAddNewMultiClass.php @@ -14,7 +14,7 @@ use SilverStripe\Forms\GridField\GridField_HTMLProvider; use SilverStripe\Forms\GridField\GridField_URLHandler; use SilverStripe\Forms\GridField\GridFieldDetailForm; -use SilverStripe\View\ArrayData; +use SilverStripe\Model\ArrayData; use ReflectionClass; use Exception; diff --git a/src/GridFieldConfigurablePaginator.php b/src/GridFieldConfigurablePaginator.php index f5872fd..f11034e 100644 --- a/src/GridFieldConfigurablePaginator.php +++ b/src/GridFieldConfigurablePaginator.php @@ -8,11 +8,11 @@ use SilverStripe\Forms\GridField\GridField_FormAction; use SilverStripe\Forms\GridField\GridFieldPaginator; use SilverStripe\Forms\GridField\GridState_Data; -use SilverStripe\ORM\ArrayList; -use SilverStripe\ORM\Limitable; -use SilverStripe\ORM\SS_List; +use SilverStripe\Model\List\ArrayList; +use SilverStripe\Model\List\Limitable; +use SilverStripe\Model\List\SS_List; use SilverStripe\ORM\UnsavedRelationList; -use SilverStripe\View\ArrayData; +use SilverStripe\Model\ArrayData; /** * GridFieldConfigurablePaginator paginates the {@link GridField} list and adds controls to the bottom of diff --git a/src/GridFieldEditableColumns.php b/src/GridFieldEditableColumns.php index b787ea4..681b7fa 100644 --- a/src/GridFieldEditableColumns.php +++ b/src/GridFieldEditableColumns.php @@ -19,7 +19,7 @@ use SilverStripe\Forms\HTMLEditor\HTMLEditorField; use SilverStripe\Forms\LiteralField; use SilverStripe\Forms\ReadonlyField; -use SilverStripe\ORM\ArrayList; +use SilverStripe\Model\List\ArrayList; use SilverStripe\ORM\DataList; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObjectInterface; diff --git a/src/GridFieldExternalLink.php b/src/GridFieldExternalLink.php index 9996481..96e7b67 100644 --- a/src/GridFieldExternalLink.php +++ b/src/GridFieldExternalLink.php @@ -3,7 +3,7 @@ namespace Symbiote\GridFieldExtensions; use SilverStripe\Forms\GridField\GridFieldDataColumns; -use SilverStripe\View\ArrayData; +use SilverStripe\Model\ArrayData; /** * Displays a link to an external source referenced 'external link' diff --git a/src/GridFieldNestedForm.php b/src/GridFieldNestedForm.php index a6f02f1..3c8fc51 100644 --- a/src/GridFieldNestedForm.php +++ b/src/GridFieldNestedForm.php @@ -23,11 +23,11 @@ use SilverStripe\ORM\DataList; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObjectInterface; -use SilverStripe\ORM\Filterable; +use SilverStripe\Model\List\Filterable; use SilverStripe\ORM\Hierarchy\Hierarchy; -use SilverStripe\ORM\SS_List; +use SilverStripe\Model\List\SS_List; use SilverStripe\Versioned\Versioned; -use SilverStripe\View\ViewableData; +use SilverStripe\Model\ModelData; use Symbiote\GridFieldExtensions\GridFieldOrderableRows; /** @@ -246,7 +246,7 @@ public function getColumnContent($gridField, $record, $columnName) GridFieldExtensions::include_requirements(); - return ViewableData::create()->customise([ + return ModelData::create()->customise([ 'Toggle' => $toggle, 'Link' => $this->Link($record->ID), 'ToggleLink' => $this->ToggleLink($record->ID), @@ -356,7 +356,7 @@ public function handleMoveToParent(GridField $gridField, $request): string public function handleNestedItem( GridField $gridField, HTTPRequest|null $request = null, - ViewableData|null $record = null + ModelData|null $record = null ): HTTPResponse|RequestHandler|Form { if ($this->atMaxNestingLevel($gridField)) { throw new Exception('Max nesting level reached'); @@ -408,7 +408,7 @@ public function handleNestedItem( public function toggleNestedItem( GridField $gridField, HTTPRequest|null $request = null, - ViewableData|null $record = null + ModelData|null $record = null ) { $list = $gridField->getList(); if (!$record && $request && $list instanceof Filterable) { diff --git a/src/GridFieldNestedFormItemRequest.php b/src/GridFieldNestedFormItemRequest.php index 471f840..50c81ac 100644 --- a/src/GridFieldNestedFormItemRequest.php +++ b/src/GridFieldNestedFormItemRequest.php @@ -16,10 +16,10 @@ use SilverStripe\Forms\GridField\GridFieldFilterHeader; use SilverStripe\Forms\GridField\GridFieldPageCount; use SilverStripe\Forms\GridField\GridFieldSortableHeader; -use SilverStripe\ORM\ArrayList; +use SilverStripe\Model\List\ArrayList; use SilverStripe\ORM\HasManyList; use SilverStripe\ORM\Hierarchy\Hierarchy; -use SilverStripe\View\ArrayData; +use SilverStripe\Model\ArrayData; use Symbiote\GridFieldExtensions\GridFieldAddNewInlineButton; use Symbiote\GridFieldExtensions\GridFieldEditableColumns; use Symbiote\GridFieldExtensions\GridFieldOrderableRows; diff --git a/src/GridFieldOrderableRows.php b/src/GridFieldOrderableRows.php index a7b650f..a94f4a5 100755 --- a/src/GridFieldOrderableRows.php +++ b/src/GridFieldOrderableRows.php @@ -17,7 +17,7 @@ use SilverStripe\Forms\GridField\GridField_URLHandler; use SilverStripe\Forms\GridField\GridFieldPaginator; use SilverStripe\Forms\HiddenField; -use SilverStripe\ORM\ArrayList; +use SilverStripe\Model\List\ArrayList; use SilverStripe\ORM\DataList; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObjectInterface; @@ -27,9 +27,9 @@ use SilverStripe\ORM\ManyManyList; use SilverStripe\ORM\ManyManyThroughList; use SilverStripe\ORM\ManyManyThroughQueryManipulator; -use SilverStripe\ORM\SS_List; +use SilverStripe\Model\List\SS_List; use SilverStripe\Versioned\Versioned; -use SilverStripe\View\ViewableData; +use SilverStripe\Model\ModelData; /** * Allows grid field rows to be re-ordered via drag and drop. Both normal data @@ -348,7 +348,7 @@ public function getColumnContent($grid, $record, $col) $sortField->addExtraClass('ss-orderable-hidden-sort'); $sortField->setForm($grid->getForm()); - return ViewableData::create()->customise(array( + return ModelData::create()->customise(array( 'SortField' => $sortField ))->renderWith('Symbiote\\GridFieldExtensions\\GridFieldOrderableRowsDragHandle'); } diff --git a/src/GridFieldRequestHandler.php b/src/GridFieldRequestHandler.php index cd95508..723efe7 100644 --- a/src/GridFieldRequestHandler.php +++ b/src/GridFieldRequestHandler.php @@ -12,7 +12,7 @@ use SilverStripe\Forms\GridField\GridFieldDetailForm_ItemRequest; use SilverStripe\Forms\Tab; use SilverStripe\Forms\TabSet; -use SilverStripe\ORM\ArrayList; +use SilverStripe\Model\List\ArrayList; /** * A base utility class for request handlers which present a grid field detail diff --git a/src/GridFieldTitleHeader.php b/src/GridFieldTitleHeader.php index 2969a88..487d783 100644 --- a/src/GridFieldTitleHeader.php +++ b/src/GridFieldTitleHeader.php @@ -4,8 +4,8 @@ use SilverStripe\Forms\GridField\AbstractGridFieldComponent; use SilverStripe\Forms\GridField\GridField_HTMLProvider; -use SilverStripe\ORM\ArrayList; -use SilverStripe\View\ArrayData; +use SilverStripe\Model\List\ArrayList; +use SilverStripe\Model\ArrayData; /** * A simple header which displays column titles. diff --git a/tests/GridFieldConfigurablePaginatorTest.php b/tests/GridFieldConfigurablePaginatorTest.php index ae6a1de..f55f378 100644 --- a/tests/GridFieldConfigurablePaginatorTest.php +++ b/tests/GridFieldConfigurablePaginatorTest.php @@ -6,7 +6,7 @@ use SilverStripe\Dev\SapphireTest; use SilverStripe\Forms\GridField\GridField; use SilverStripe\Forms\GridField\GridField_FormAction; -use SilverStripe\ORM\ArrayList; +use SilverStripe\Model\List\ArrayList; use Symbiote\GridFieldExtensions\GridFieldConfigurablePaginator; class GridFieldConfigurablePaginatorTest extends SapphireTest diff --git a/tests/GridFieldNestedFormTest.php b/tests/GridFieldNestedFormTest.php index c7b975f..44d7c9e 100644 --- a/tests/GridFieldNestedFormTest.php +++ b/tests/GridFieldNestedFormTest.php @@ -8,7 +8,7 @@ use SilverStripe\Forms\Form; use SilverStripe\Forms\GridField\GridField; use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor; -use SilverStripe\ORM\ArrayList; +use SilverStripe\Model\List\ArrayList; use Symbiote\GridFieldExtensions\GridFieldNestedForm; use Symbiote\GridFieldExtensions\Tests\Stub\StubHierarchy; use Symbiote\GridFieldExtensions\Tests\Stub\StubOrdered; diff --git a/tests/GridFieldOrderableRowsTest.php b/tests/GridFieldOrderableRowsTest.php index 6cf438b..1c5a6b7 100644 --- a/tests/GridFieldOrderableRowsTest.php +++ b/tests/GridFieldOrderableRowsTest.php @@ -6,7 +6,7 @@ use SilverStripe\Dev\SapphireTest; use SilverStripe\Forms\GridField\GridField; use SilverStripe\Forms\GridField\GridFieldConfig_RelationEditor; -use SilverStripe\ORM\ArrayList; +use SilverStripe\Model\List\ArrayList; use SilverStripe\ORM\DataList; use Symbiote\GridFieldExtensions\GridFieldOrderableRows; use Symbiote\GridFieldExtensions\Tests\Stub\PolymorphM2MMapper;