From fe78bb6c1206c7e7fb3656efe4f7a4605c3ee3b7 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Tue, 17 Sep 2024 13:43:14 +1200 Subject: [PATCH] API Use new names for renamed classes --- docs/en/05_plugins/03_writing_a_complex_plugin.md | 6 +++--- src/Auth/AuthenticatorInterface.php | 2 +- src/Auth/BasicAuthAuthenticator.php | 2 +- src/Auth/Handler.php | 2 +- src/Modules/AssetAdmin/FileFilter.php | 4 ++-- .../AssetAdmin/Resolvers/AssetAdminResolver.php | 2 +- .../AssetAdmin/Resolvers/FolderTypeResolver.php | 2 +- src/Modules/AssetAdmin/Schema/Builder.php | 2 +- src/Modules/CMS/LinkablePlugin.php | 2 +- .../Operations/AbstractPublishOperationCreator.php | 6 +++--- .../Versioned/Operations/CopyToStageCreator.php | 4 ++-- src/Modules/Versioned/Operations/RollbackCreator.php | 4 ++-- src/Modules/Versioned/Plugins/UnpublishOnDelete.php | 4 ++-- src/Modules/Versioned/Plugins/VersionedDataObject.php | 6 +++--- src/Modules/Versioned/Plugins/VersionedRead.php | 4 ++-- src/Modules/Versioned/Resolvers/VersionedResolver.php | 2 +- src/QueryHandler/QueryHandler.php | 2 +- src/Schema/BulkLoader/ExtensionLoader.php | 6 +++--- src/Schema/DataObject/DataObjectModel.php | 2 +- src/Schema/DataObject/FieldAccessor.php | 2 +- src/Schema/DataObject/Plugin/CanViewPermission.php | 10 +++++----- src/Schema/DataObject/Plugin/FirstResult.php | 6 +++--- src/Schema/DataObject/Plugin/Paginator.php | 2 +- .../Plugin/QueryFilter/FieldFilterInterface.php | 2 +- .../Plugin/QueryFilter/Filters/ContainsFilter.php | 2 +- .../Plugin/QueryFilter/Filters/EndsWithFilter.php | 2 +- .../Plugin/QueryFilter/Filters/EqualToFilter.php | 2 +- .../Plugin/QueryFilter/Filters/GreaterThanFilter.php | 2 +- .../QueryFilter/Filters/GreaterThanOrEqualFilter.php | 2 +- .../DataObject/Plugin/QueryFilter/Filters/InFilter.php | 2 +- .../Plugin/QueryFilter/Filters/LessThanFilter.php | 2 +- .../QueryFilter/Filters/LessThanOrEqualFilter.php | 2 +- .../Plugin/QueryFilter/Filters/NotEqualFilter.php | 2 +- .../Plugin/QueryFilter/Filters/StartsWithFilter.php | 2 +- .../DataObject/Plugin/QueryFilter/QueryFilter.php | 2 +- src/Schema/DataObject/Plugin/QuerySort.php | 2 +- src/Schema/DataObject/Plugin/ScalarDBField.php | 2 +- src/Schema/DataObject/Resolver.php | 4 ++-- src/Schema/Field/Argument.php | 2 +- src/Schema/Plugin/SortPlugin.php | 2 +- src/Schema/Schema.php | 2 +- src/Schema/Services/NestedInputBuilder.php | 2 +- src/Schema/Type/EncodedType.php | 2 +- src/Schema/Type/Enum.php | 2 +- src/Schema/Type/ModelType.php | 2 +- tests/Auth/HandlerTest.php | 6 +++--- tests/Fake/BrutalAuthenticatorFake.php | 2 +- tests/Modules/AssetAdmin/ReadFileQueryCreatorTest.php | 2 +- .../Plugins/VersionedDataObjectPluginTest.php | 2 +- tests/Schema/DataObject/Plugin/FiltersTest.php | 2 +- 50 files changed, 72 insertions(+), 72 deletions(-) diff --git a/docs/en/05_plugins/03_writing_a_complex_plugin.md b/docs/en/05_plugins/03_writing_a_complex_plugin.md index f81f38992..a116e26eb 100644 --- a/docs/en/05_plugins/03_writing_a_complex_plugin.md +++ b/docs/en/05_plugins/03_writing_a_complex_plugin.md @@ -57,7 +57,7 @@ class GeocodableModelPlugin implements ModelTypePlugin ); // only apply the plugin to geocodable DataObjects - if (!ViewableData::has_extension($class, GeocodableExtension::class)) { + if (!ModelData::has_extension($class, GeocodableExtension::class)) { return; } @@ -100,7 +100,7 @@ class GeocodableQueryPlugin implements ModelQueryPlugin { $class = $query->getModel()->getSourceClass(); // Only apply to geocodable objects - if (!ViewableData::has_extension($class, GeocodableExtension::class)) { + if (!ModelData::has_extension($class, GeocodableExtension::class)) { return; } @@ -216,7 +216,7 @@ class GeocodableQueryPlugin implements ModelQueryPlugin, SchemaUpdater { $class = $query->getModel()->getSourceClass(); // Only apply to geocodable objects - if (!ViewableData::has_extension($class, GeocodableExtension::class)) { + if (!ModelData::has_extension($class, GeocodableExtension::class)) { return; } diff --git a/src/Auth/AuthenticatorInterface.php b/src/Auth/AuthenticatorInterface.php index d9fdf9872..89af8ed6c 100644 --- a/src/Auth/AuthenticatorInterface.php +++ b/src/Auth/AuthenticatorInterface.php @@ -3,7 +3,7 @@ namespace SilverStripe\GraphQL\Auth; use SilverStripe\Control\HTTPRequest; -use SilverStripe\ORM\ValidationException; +use SilverStripe\Core\Validation\ValidationException; use SilverStripe\Security\Member; /** diff --git a/src/Auth/BasicAuthAuthenticator.php b/src/Auth/BasicAuthAuthenticator.php index dfa68df32..d3899b8ba 100644 --- a/src/Auth/BasicAuthAuthenticator.php +++ b/src/Auth/BasicAuthAuthenticator.php @@ -4,7 +4,7 @@ use SilverStripe\Control\HTTPRequest; use SilverStripe\Control\HTTPResponse_Exception; -use SilverStripe\ORM\ValidationException; +use SilverStripe\Core\Validation\ValidationException; use SilverStripe\Security\BasicAuth; use SilverStripe\Security\Member; diff --git a/src/Auth/Handler.php b/src/Auth/Handler.php index 46f6442f0..394001fd8 100644 --- a/src/Auth/Handler.php +++ b/src/Auth/Handler.php @@ -6,7 +6,7 @@ use SilverStripe\Core\ClassInfo; use SilverStripe\Core\Config\Configurable; use SilverStripe\Core\Injector\Injector; -use SilverStripe\ORM\ValidationException; +use SilverStripe\Core\Validation\ValidationException; use SilverStripe\Security\Member; /** diff --git a/src/Modules/AssetAdmin/FileFilter.php b/src/Modules/AssetAdmin/FileFilter.php index d7d1cd3b3..d752cbefe 100644 --- a/src/Modules/AssetAdmin/FileFilter.php +++ b/src/Modules/AssetAdmin/FileFilter.php @@ -8,8 +8,8 @@ use SilverStripe\Assets\Folder; use SilverStripe\Control\HTTPResponse_Exception; use SilverStripe\Forms\DateField; -use SilverStripe\ORM\ArrayList; -use SilverStripe\ORM\Filterable; +use SilverStripe\Model\List\ArrayList; +use SilverStripe\Model\List\Filterable; class FileFilter { diff --git a/src/Modules/AssetAdmin/Resolvers/AssetAdminResolver.php b/src/Modules/AssetAdmin/Resolvers/AssetAdminResolver.php index 17303f6b3..d09de0717 100644 --- a/src/Modules/AssetAdmin/Resolvers/AssetAdminResolver.php +++ b/src/Modules/AssetAdmin/Resolvers/AssetAdminResolver.php @@ -13,7 +13,7 @@ use SilverStripe\GraphQL\QueryHandler\UserContextProvider; use SilverStripe\GraphQL\Schema\DataObject\FieldAccessor; use SilverStripe\ORM\DataList; -use SilverStripe\ORM\Filterable; +use SilverStripe\Model\List\Filterable; use SilverStripe\Versioned\Versioned; use InvalidArgumentException; diff --git a/src/Modules/AssetAdmin/Resolvers/FolderTypeResolver.php b/src/Modules/AssetAdmin/Resolvers/FolderTypeResolver.php index 31d5ce884..71a1658cb 100644 --- a/src/Modules/AssetAdmin/Resolvers/FolderTypeResolver.php +++ b/src/Modules/AssetAdmin/Resolvers/FolderTypeResolver.php @@ -13,7 +13,7 @@ use SilverStripe\GraphQL\Schema\Schema; use SilverStripe\ORM\DataList; use SilverStripe\ORM\DB; -use SilverStripe\ORM\Sortable; +use SilverStripe\Model\List\Sortable; use SilverStripe\Versioned\Versioned; use InvalidArgumentException; use Exception; diff --git a/src/Modules/AssetAdmin/Schema/Builder.php b/src/Modules/AssetAdmin/Schema/Builder.php index 534fcce84..5a659f8ae 100644 --- a/src/Modules/AssetAdmin/Schema/Builder.php +++ b/src/Modules/AssetAdmin/Schema/Builder.php @@ -7,7 +7,7 @@ use SilverStripe\GraphQL\Schema\Interfaces\SchemaUpdater; use SilverStripe\GraphQL\Schema\Schema; use SilverStripe\GraphQL\Schema\Type\Enum; -use SilverStripe\ORM\ArrayLib; +use SilverStripe\Core\ArrayLib; if (!interface_exists(SchemaUpdater::class)) { return; diff --git a/src/Modules/CMS/LinkablePlugin.php b/src/Modules/CMS/LinkablePlugin.php index f441970fb..7999fe6d0 100644 --- a/src/Modules/CMS/LinkablePlugin.php +++ b/src/Modules/CMS/LinkablePlugin.php @@ -11,7 +11,7 @@ use SilverStripe\GraphQL\Schema\Field\ModelQuery; use SilverStripe\GraphQL\Schema\Interfaces\ModelQueryPlugin; use SilverStripe\GraphQL\Schema\Schema; -use SilverStripe\ORM\ArrayList; +use SilverStripe\Model\List\ArrayList; use SilverStripe\ORM\DataList; if (!interface_exists(ModelQueryPlugin::class)) { diff --git a/src/Modules/Versioned/Operations/AbstractPublishOperationCreator.php b/src/Modules/Versioned/Operations/AbstractPublishOperationCreator.php index 9e61007cd..6ea483c5d 100644 --- a/src/Modules/Versioned/Operations/AbstractPublishOperationCreator.php +++ b/src/Modules/Versioned/Operations/AbstractPublishOperationCreator.php @@ -18,11 +18,11 @@ use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObjectInterface; use SilverStripe\ORM\DB; -use SilverStripe\ORM\ValidationException; +use SilverStripe\Core\Validation\ValidationException; use SilverStripe\Security\Member; use SilverStripe\GraphQL\Modules\Versioned\Resolvers\VersionedResolver; use SilverStripe\Versioned\Versioned; -use SilverStripe\View\ViewableData; +use SilverStripe\Model\ModelData; // GraphQL dependency is optional in versioned, // and the following implementation relies on existence of this class (in GraphQL v4) @@ -53,7 +53,7 @@ public function createOperation( string $typeName, array $config = [] ): ?ModelOperation { - if (!ViewableData::has_extension($model->getSourceClass(), Versioned::class)) { + if (!ModelData::has_extension($model->getSourceClass(), Versioned::class)) { return null; } diff --git a/src/Modules/Versioned/Operations/CopyToStageCreator.php b/src/Modules/Versioned/Operations/CopyToStageCreator.php index cfae46bed..624d40e86 100644 --- a/src/Modules/Versioned/Operations/CopyToStageCreator.php +++ b/src/Modules/Versioned/Operations/CopyToStageCreator.php @@ -12,7 +12,7 @@ use SilverStripe\GraphQL\Schema\Interfaces\SchemaModelInterface; use SilverStripe\GraphQL\Modules\Versioned\Resolvers\VersionedResolver; use SilverStripe\Versioned\Versioned; -use SilverStripe\View\ViewableData; +use SilverStripe\Model\ModelData; // GraphQL dependency is optional in versioned, // and the following implementation relies on existence of this class (in GraphQL v4) @@ -49,7 +49,7 @@ public function createOperation( string $typeName, array $config = [] ): ?ModelOperation { - if (!ViewableData::has_extension($model->getSourceClass(), Versioned::class)) { + if (!ModelData::has_extension($model->getSourceClass(), Versioned::class)) { return null; } diff --git a/src/Modules/Versioned/Operations/RollbackCreator.php b/src/Modules/Versioned/Operations/RollbackCreator.php index 8ea367259..41faf3812 100644 --- a/src/Modules/Versioned/Operations/RollbackCreator.php +++ b/src/Modules/Versioned/Operations/RollbackCreator.php @@ -11,7 +11,7 @@ use SilverStripe\GraphQL\Schema\Interfaces\SchemaModelInterface; use SilverStripe\GraphQL\Modules\Versioned\Resolvers\VersionedResolver; use SilverStripe\Versioned\Versioned; -use SilverStripe\View\ViewableData; +use SilverStripe\Model\ModelData; // GraphQL dependency is optional in versioned, // and the following implementation relies on existence of this class (in GraphQL v4) @@ -47,7 +47,7 @@ public function createOperation( string $typeName, array $config = [] ): ?ModelOperation { - if (!ViewableData::has_extension($model->getSourceClass(), Versioned::class)) { + if (!ModelData::has_extension($model->getSourceClass(), Versioned::class)) { return null; } diff --git a/src/Modules/Versioned/Plugins/UnpublishOnDelete.php b/src/Modules/Versioned/Plugins/UnpublishOnDelete.php index e878115af..dcaae6adb 100644 --- a/src/Modules/Versioned/Plugins/UnpublishOnDelete.php +++ b/src/Modules/Versioned/Plugins/UnpublishOnDelete.php @@ -14,7 +14,7 @@ use SilverStripe\Versioned\Versioned; use Exception; use Closure; -use SilverStripe\View\ViewableData; +use SilverStripe\Model\ModelData; // GraphQL dependency is optional in versioned, // and the following implementation relies on existence of this class (in GraphQL v4) @@ -53,7 +53,7 @@ public static function unpublishOnDelete(array $context) if (!$dataClass) { return; } - if (!ViewableData::has_extension($dataClass, Versioned::class)) { + if (!ModelData::has_extension($dataClass, Versioned::class)) { return; } DB::get_conn()->withTransaction(function () use ($args, $context, $dataClass) { diff --git a/src/Modules/Versioned/Plugins/VersionedDataObject.php b/src/Modules/Versioned/Plugins/VersionedDataObject.php index b43ab5bae..6f1864fbd 100644 --- a/src/Modules/Versioned/Plugins/VersionedDataObject.php +++ b/src/Modules/Versioned/Plugins/VersionedDataObject.php @@ -17,12 +17,12 @@ use SilverStripe\GraphQL\Schema\Type\ModelType; use SilverStripe\GraphQL\Schema\Type\Type; use SilverStripe\ORM\DataObject; -use SilverStripe\ORM\Sortable; +use SilverStripe\Model\List\Sortable; use SilverStripe\Security\Member; use SilverStripe\GraphQL\Modules\Versioned\Resolvers\VersionedResolver; use SilverStripe\Versioned\Versioned; use Closure; -use SilverStripe\View\ViewableData; +use SilverStripe\Model\ModelData; // GraphQL dependency is optional in versioned, // and the following implementation relies on existence of this class (in GraphQL v4) @@ -75,7 +75,7 @@ public function apply(ModelType $type, Schema $schema, array $config = []): void __CLASS__, DataObject::class ); - if (!ViewableData::has_extension($class, Versioned::class)) { + if (!ModelData::has_extension($class, Versioned::class)) { return; } diff --git a/src/Modules/Versioned/Plugins/VersionedRead.php b/src/Modules/Versioned/Plugins/VersionedRead.php index 18fcdb7ab..5dea93f4b 100644 --- a/src/Modules/Versioned/Plugins/VersionedRead.php +++ b/src/Modules/Versioned/Plugins/VersionedRead.php @@ -8,7 +8,7 @@ use SilverStripe\GraphQL\Schema\Schema; use SilverStripe\GraphQL\Modules\Versioned\Resolvers\VersionedResolver; use SilverStripe\Versioned\Versioned; -use SilverStripe\View\ViewableData; +use SilverStripe\Model\ModelData; // GraphQL dependency is optional in versioned, // and the following implementation relies on existence of this class (in GraphQL v4) @@ -36,7 +36,7 @@ public function getIdentifier(): string public function apply(ModelQuery $query, Schema $schema, array $config = []): void { $class = $query->getModel()->getSourceClass(); - if (!ViewableData::has_extension($class, Versioned::class)) { + if (!ModelData::has_extension($class, Versioned::class)) { return; } diff --git a/src/Modules/Versioned/Resolvers/VersionedResolver.php b/src/Modules/Versioned/Resolvers/VersionedResolver.php index 6245d876b..7a7a3d5f3 100644 --- a/src/Modules/Versioned/Resolvers/VersionedResolver.php +++ b/src/Modules/Versioned/Resolvers/VersionedResolver.php @@ -11,7 +11,7 @@ use SilverStripe\ORM\DataList; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DB; -use SilverStripe\ORM\ValidationException; +use SilverStripe\Core\Validation\ValidationException; use SilverStripe\GraphQL\Modules\Versioned\Operations\AbstractPublishOperationCreator; use SilverStripe\GraphQL\Modules\Versioned\Operations\CopyToStageCreator; use SilverStripe\GraphQL\Modules\Versioned\Operations\RollbackCreator; diff --git a/src/QueryHandler/QueryHandler.php b/src/QueryHandler/QueryHandler.php index 8ab46b2aa..a4260f62d 100644 --- a/src/QueryHandler/QueryHandler.php +++ b/src/QueryHandler/QueryHandler.php @@ -31,7 +31,7 @@ use SilverStripe\GraphQL\Schema\Interfaces\ContextProvider; use SilverStripe\GraphQL\Schema\Schema; use SilverStripe\GraphQL\Schema\SchemaConfig; -use SilverStripe\ORM\ValidationException; +use SilverStripe\Core\Validation\ValidationException; /** * This class is responsible for taking query information from a controller, diff --git a/src/Schema/BulkLoader/ExtensionLoader.php b/src/Schema/BulkLoader/ExtensionLoader.php index 4f18ec491..aa751950b 100644 --- a/src/Schema/BulkLoader/ExtensionLoader.php +++ b/src/Schema/BulkLoader/ExtensionLoader.php @@ -4,7 +4,7 @@ use InvalidArgumentException; use SilverStripe\Core\Extension; -use SilverStripe\View\ViewableData; +use SilverStripe\Model\ModelData; /** * Loads classes that have a given extension assigned to them. @@ -25,13 +25,13 @@ public function collect(Collection $collection): Collection foreach ($collection->getClasses() as $class) { $isIncluded = false; foreach ($this->includeList as $pattern) { - if (ViewableData::has_extension($class, $pattern)) { + if (ModelData::has_extension($class, $pattern)) { $isIncluded = true; break; } } foreach ($this->excludeList as $pattern) { - if (ViewableData::has_extension($class, $pattern)) { + if (ModelData::has_extension($class, $pattern)) { $isIncluded = false; break; } diff --git a/src/Schema/DataObject/DataObjectModel.php b/src/Schema/DataObject/DataObjectModel.php index d66ad48ba..678b89ca8 100644 --- a/src/Schema/DataObject/DataObjectModel.php +++ b/src/Schema/DataObject/DataObjectModel.php @@ -23,7 +23,7 @@ use SilverStripe\GraphQL\Schema\Interfaces\SchemaModelInterface; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\FieldType\DBField; -use SilverStripe\ORM\SS_List; +use SilverStripe\Model\List\SS_List; use SilverStripe\ORM\UnsavedRelationList; /** diff --git a/src/Schema/DataObject/FieldAccessor.php b/src/Schema/DataObject/FieldAccessor.php index 801d66291..ba59a8672 100644 --- a/src/Schema/DataObject/FieldAccessor.php +++ b/src/Schema/DataObject/FieldAccessor.php @@ -13,7 +13,7 @@ use SilverStripe\ORM\DataObjectSchema; use SilverStripe\ORM\FieldType\DBField; use SilverStripe\ORM\RelationList; -use SilverStripe\ORM\SS_List; +use SilverStripe\Model\List\SS_List; use LogicException; use SilverStripe\ORM\UnsavedRelationList; diff --git a/src/Schema/DataObject/Plugin/CanViewPermission.php b/src/Schema/DataObject/Plugin/CanViewPermission.php index ce91e36da..df74b7bf4 100644 --- a/src/Schema/DataObject/Plugin/CanViewPermission.php +++ b/src/Schema/DataObject/Plugin/CanViewPermission.php @@ -7,12 +7,12 @@ use SilverStripe\Core\ClassInfo; use SilverStripe\GraphQL\QueryHandler\QueryHandler; use SilverStripe\GraphQL\QueryHandler\UserContextProvider; -use SilverStripe\ORM\ArrayLib; -use SilverStripe\ORM\ArrayList; -use SilverStripe\ORM\Filterable; +use SilverStripe\Core\ArrayLib; +use SilverStripe\Model\List\ArrayList; +use SilverStripe\Model\List\Filterable; use InvalidArgumentException; -use SilverStripe\ORM\SS_List; -use SilverStripe\View\ArrayData; +use SilverStripe\Model\List\SS_List; +use SilverStripe\Model\ArrayData; use SilverStripe\ORM\DataList; /** diff --git a/src/Schema/DataObject/Plugin/FirstResult.php b/src/Schema/DataObject/Plugin/FirstResult.php index 2a8f610f1..ae9cac8ad 100644 --- a/src/Schema/DataObject/Plugin/FirstResult.php +++ b/src/Schema/DataObject/Plugin/FirstResult.php @@ -9,8 +9,8 @@ use SilverStripe\GraphQL\Schema\Schema; use SilverStripe\ORM\DataList; use SilverStripe\ORM\DataObject; -use SilverStripe\ORM\SS_List; -use SilverStripe\View\ViewableData; +use SilverStripe\Model\List\SS_List; +use SilverStripe\Model\ModelData; class FirstResult implements ModelQueryPlugin { @@ -38,7 +38,7 @@ public function apply(ModelQuery $query, Schema $schema, array $config = []): vo $query->addResolverAfterware([static::class, 'firstResult']); } - public static function firstResult(SS_List $obj): ?ViewableData + public static function firstResult(SS_List $obj): ?ModelData { return $obj->first(); } diff --git a/src/Schema/DataObject/Plugin/Paginator.php b/src/Schema/DataObject/Plugin/Paginator.php index c425ed603..d605e386d 100644 --- a/src/Schema/DataObject/Plugin/Paginator.php +++ b/src/Schema/DataObject/Plugin/Paginator.php @@ -4,7 +4,7 @@ use GraphQL\Type\Definition\ResolveInfo; use SilverStripe\GraphQL\Schema\Schema; -use SilverStripe\ORM\Limitable; +use SilverStripe\Model\List\Limitable; use SilverStripe\GraphQL\Schema\Plugin\PaginationPlugin; use Closure; diff --git a/src/Schema/DataObject/Plugin/QueryFilter/FieldFilterInterface.php b/src/Schema/DataObject/Plugin/QueryFilter/FieldFilterInterface.php index 03de8f80e..cd4d02137 100644 --- a/src/Schema/DataObject/Plugin/QueryFilter/FieldFilterInterface.php +++ b/src/Schema/DataObject/Plugin/QueryFilter/FieldFilterInterface.php @@ -4,7 +4,7 @@ namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter; use SilverStripe\ORM\DataList; -use SilverStripe\ORM\Filterable; +use SilverStripe\Model\List\Filterable; /** * Defines the interface used by all read filters for operations diff --git a/src/Schema/DataObject/Plugin/QueryFilter/Filters/ContainsFilter.php b/src/Schema/DataObject/Plugin/QueryFilter/Filters/ContainsFilter.php index c471c9268..35cf401d8 100644 --- a/src/Schema/DataObject/Plugin/QueryFilter/Filters/ContainsFilter.php +++ b/src/Schema/DataObject/Plugin/QueryFilter/Filters/ContainsFilter.php @@ -4,7 +4,7 @@ namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters; use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\FieldFilterInterface; -use SilverStripe\ORM\Filterable; +use SilverStripe\Model\List\Filterable; /** * A filter that selects records that partially match a keyword diff --git a/src/Schema/DataObject/Plugin/QueryFilter/Filters/EndsWithFilter.php b/src/Schema/DataObject/Plugin/QueryFilter/Filters/EndsWithFilter.php index 6f49a094b..b659a01c1 100644 --- a/src/Schema/DataObject/Plugin/QueryFilter/Filters/EndsWithFilter.php +++ b/src/Schema/DataObject/Plugin/QueryFilter/Filters/EndsWithFilter.php @@ -4,7 +4,7 @@ namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters; use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\FieldFilterInterface; -use SilverStripe\ORM\Filterable; +use SilverStripe\Model\List\Filterable; /** * A query filter that filters records by the end of a field's contents diff --git a/src/Schema/DataObject/Plugin/QueryFilter/Filters/EqualToFilter.php b/src/Schema/DataObject/Plugin/QueryFilter/Filters/EqualToFilter.php index 8d8a46137..0bf68d096 100644 --- a/src/Schema/DataObject/Plugin/QueryFilter/Filters/EqualToFilter.php +++ b/src/Schema/DataObject/Plugin/QueryFilter/Filters/EqualToFilter.php @@ -4,7 +4,7 @@ namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters; use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\FieldFilterInterface; -use SilverStripe\ORM\Filterable; +use SilverStripe\Model\List\Filterable; /** * A query filter that filters records by exact match of a keyword diff --git a/src/Schema/DataObject/Plugin/QueryFilter/Filters/GreaterThanFilter.php b/src/Schema/DataObject/Plugin/QueryFilter/Filters/GreaterThanFilter.php index cecf3d0ea..6be39d013 100644 --- a/src/Schema/DataObject/Plugin/QueryFilter/Filters/GreaterThanFilter.php +++ b/src/Schema/DataObject/Plugin/QueryFilter/Filters/GreaterThanFilter.php @@ -4,7 +4,7 @@ namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters; use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\FieldFilterInterface; -use SilverStripe\ORM\Filterable; +use SilverStripe\Model\List\Filterable; /** * A query filter that filters records by greater than comparison diff --git a/src/Schema/DataObject/Plugin/QueryFilter/Filters/GreaterThanOrEqualFilter.php b/src/Schema/DataObject/Plugin/QueryFilter/Filters/GreaterThanOrEqualFilter.php index bdf3c3c1a..63ff36507 100644 --- a/src/Schema/DataObject/Plugin/QueryFilter/Filters/GreaterThanOrEqualFilter.php +++ b/src/Schema/DataObject/Plugin/QueryFilter/Filters/GreaterThanOrEqualFilter.php @@ -4,7 +4,7 @@ namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters; use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\FieldFilterInterface; -use SilverStripe\ORM\Filterable; +use SilverStripe\Model\List\Filterable; /** * A query filter that filters records by greater than or equal comparison diff --git a/src/Schema/DataObject/Plugin/QueryFilter/Filters/InFilter.php b/src/Schema/DataObject/Plugin/QueryFilter/Filters/InFilter.php index e09d58b0d..eccb45f16 100644 --- a/src/Schema/DataObject/Plugin/QueryFilter/Filters/InFilter.php +++ b/src/Schema/DataObject/Plugin/QueryFilter/Filters/InFilter.php @@ -4,7 +4,7 @@ namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters; use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\ListFieldFilterInterface; -use SilverStripe\ORM\Filterable; +use SilverStripe\Model\List\Filterable; /** * A query filter that filters records by the presence of a value in an array diff --git a/src/Schema/DataObject/Plugin/QueryFilter/Filters/LessThanFilter.php b/src/Schema/DataObject/Plugin/QueryFilter/Filters/LessThanFilter.php index 61c3d26eb..311d61f92 100644 --- a/src/Schema/DataObject/Plugin/QueryFilter/Filters/LessThanFilter.php +++ b/src/Schema/DataObject/Plugin/QueryFilter/Filters/LessThanFilter.php @@ -4,7 +4,7 @@ namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters; use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\FieldFilterInterface; -use SilverStripe\ORM\Filterable; +use SilverStripe\Model\List\Filterable; /** * A query filter that filters records by a less than comparison diff --git a/src/Schema/DataObject/Plugin/QueryFilter/Filters/LessThanOrEqualFilter.php b/src/Schema/DataObject/Plugin/QueryFilter/Filters/LessThanOrEqualFilter.php index 107168a51..9909cf666 100644 --- a/src/Schema/DataObject/Plugin/QueryFilter/Filters/LessThanOrEqualFilter.php +++ b/src/Schema/DataObject/Plugin/QueryFilter/Filters/LessThanOrEqualFilter.php @@ -4,7 +4,7 @@ namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters; use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\FieldFilterInterface; -use SilverStripe\ORM\Filterable; +use SilverStripe\Model\List\Filterable; /** * A query filter that filters records by a less than or equal comparison diff --git a/src/Schema/DataObject/Plugin/QueryFilter/Filters/NotEqualFilter.php b/src/Schema/DataObject/Plugin/QueryFilter/Filters/NotEqualFilter.php index d19a05668..80b4b91ef 100644 --- a/src/Schema/DataObject/Plugin/QueryFilter/Filters/NotEqualFilter.php +++ b/src/Schema/DataObject/Plugin/QueryFilter/Filters/NotEqualFilter.php @@ -4,7 +4,7 @@ namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters; use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\FieldFilterInterface; -use SilverStripe\ORM\Filterable; +use SilverStripe\Model\List\Filterable; /** * A query filter that filters records by negating an exact match diff --git a/src/Schema/DataObject/Plugin/QueryFilter/Filters/StartsWithFilter.php b/src/Schema/DataObject/Plugin/QueryFilter/Filters/StartsWithFilter.php index 9fbabd3c9..61cc68a3f 100644 --- a/src/Schema/DataObject/Plugin/QueryFilter/Filters/StartsWithFilter.php +++ b/src/Schema/DataObject/Plugin/QueryFilter/Filters/StartsWithFilter.php @@ -4,7 +4,7 @@ namespace SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters; use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\FieldFilterInterface; -use SilverStripe\ORM\Filterable; +use SilverStripe\Model\List\Filterable; /** * A query filter that filters records by the start of a field's content diff --git a/src/Schema/DataObject/Plugin/QueryFilter/QueryFilter.php b/src/Schema/DataObject/Plugin/QueryFilter/QueryFilter.php index d7a4fc848..1a322a8ec 100644 --- a/src/Schema/DataObject/Plugin/QueryFilter/QueryFilter.php +++ b/src/Schema/DataObject/Plugin/QueryFilter/QueryFilter.php @@ -18,7 +18,7 @@ use SilverStripe\GraphQL\Schema\Type\ModelType; use SilverStripe\ORM\DataObject; use Closure; -use SilverStripe\ORM\Filterable; +use SilverStripe\Model\List\Filterable; use Exception; /** diff --git a/src/Schema/DataObject/Plugin/QuerySort.php b/src/Schema/DataObject/Plugin/QuerySort.php index 8b9530211..300a03d67 100644 --- a/src/Schema/DataObject/Plugin/QuerySort.php +++ b/src/Schema/DataObject/Plugin/QuerySort.php @@ -16,7 +16,7 @@ use SilverStripe\GraphQL\Schema\Type\ModelType; use SilverStripe\ORM\DataObject; use Closure; -use SilverStripe\ORM\Sortable; +use SilverStripe\Model\List\Sortable; use Exception; use GraphQL\Type\Definition\ResolveInfo; use SilverStripe\GraphQL\Schema\Traits\SortTrait; diff --git a/src/Schema/DataObject/Plugin/ScalarDBField.php b/src/Schema/DataObject/Plugin/ScalarDBField.php index 7ba711db7..8fad6c818 100644 --- a/src/Schema/DataObject/Plugin/ScalarDBField.php +++ b/src/Schema/DataObject/Plugin/ScalarDBField.php @@ -11,7 +11,7 @@ use SilverStripe\ORM\FieldType\DBField; /** - * Ensures any field that ends up as ViewableData, e.g. DBField, + * Ensures any field that ends up as ModelData, e.g. DBField, * invokes forTemplate() after resolving. */ class ScalarDBField implements ModelTypePlugin diff --git a/src/Schema/DataObject/Resolver.php b/src/Schema/DataObject/Resolver.php index 328cf69a8..7ef636249 100644 --- a/src/Schema/DataObject/Resolver.php +++ b/src/Schema/DataObject/Resolver.php @@ -10,7 +10,7 @@ use SilverStripe\ORM\DataList; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\FieldType\DBField; -use SilverStripe\ORM\SS_List; +use SilverStripe\Model\List\SS_List; /** * Generic resolver for DataObjects @@ -34,7 +34,7 @@ public static function resolve($obj, $args = [], $context = [], ?ResolveInfo $in } /** - * Just the basic ViewableData field accessor bit, without all the property mapping + * Just the basic ModelData field accessor bit, without all the property mapping * overhead. Useful for custom dataobject types that circumvent the model layer. * * @param DataObject $obj diff --git a/src/Schema/Field/Argument.php b/src/Schema/Field/Argument.php index 5e224fa17..c5e8e6d2d 100644 --- a/src/Schema/Field/Argument.php +++ b/src/Schema/Field/Argument.php @@ -12,7 +12,7 @@ use SilverStripe\GraphQL\Schema\Schema; use SilverStripe\GraphQL\Schema\Type\EncodedType; use SilverStripe\GraphQL\Schema\Type\TypeReference; -use SilverStripe\View\ViewableData; +use SilverStripe\Model\ModelData; /** * An abstraction of a field argument diff --git a/src/Schema/Plugin/SortPlugin.php b/src/Schema/Plugin/SortPlugin.php index 06c6ffa98..9fbfe46a5 100644 --- a/src/Schema/Plugin/SortPlugin.php +++ b/src/Schema/Plugin/SortPlugin.php @@ -16,7 +16,7 @@ use SilverStripe\GraphQL\Schema\Services\NestedInputBuilder; use SilverStripe\GraphQL\Schema\Traits\SortTrait; use SilverStripe\GraphQL\Schema\Type\InputType; -use SilverStripe\ORM\Sortable; +use SilverStripe\Model\List\Sortable; use Closure; use GraphQL\Type\Definition\ResolveInfo; diff --git a/src/Schema/Schema.php b/src/Schema/Schema.php index f4d778ad7..a05fdbc29 100644 --- a/src/Schema/Schema.php +++ b/src/Schema/Schema.php @@ -34,7 +34,7 @@ use SilverStripe\GraphQL\Schema\Type\Type; use SilverStripe\GraphQL\Schema\Type\TypeReference; use SilverStripe\GraphQL\Schema\Type\UnionType; -use SilverStripe\ORM\ArrayLib; +use SilverStripe\Core\ArrayLib; use Exception; use SilverStripe\Core\Injector\Injector; use TypeError; diff --git a/src/Schema/Services/NestedInputBuilder.php b/src/Schema/Services/NestedInputBuilder.php index 44f17af1f..f3decc39c 100644 --- a/src/Schema/Services/NestedInputBuilder.php +++ b/src/Schema/Services/NestedInputBuilder.php @@ -14,7 +14,7 @@ use SilverStripe\GraphQL\Schema\Type\ModelUnionType; use SilverStripe\GraphQL\Schema\Type\Type; use SilverStripe\GraphQL\Schema\Type\TypeReference; -use SilverStripe\ORM\ArrayLib; +use SilverStripe\Core\ArrayLib; /** * An agnostic service that builds an input type based on a given field, with nesting. diff --git a/src/Schema/Type/EncodedType.php b/src/Schema/Type/EncodedType.php index 626ad6bd2..2ec007b43 100644 --- a/src/Schema/Type/EncodedType.php +++ b/src/Schema/Type/EncodedType.php @@ -12,7 +12,7 @@ use SilverStripe\GraphQL\Schema\Interfaces\Encoder; use SilverStripe\GraphQL\Schema\Schema; use SilverStripe\GraphQL\Schema\Storage\CodeGenerationStore; -use SilverStripe\View\ViewableData; +use SilverStripe\Model\ModelData; /** * A type that can be expressed as generated PHP code diff --git a/src/Schema/Type/Enum.php b/src/Schema/Type/Enum.php index 600acc985..d60a32bca 100644 --- a/src/Schema/Type/Enum.php +++ b/src/Schema/Type/Enum.php @@ -6,7 +6,7 @@ use SilverStripe\GraphQL\Schema\Exception\SchemaBuilderException; use SilverStripe\GraphQL\Schema\Interfaces\SchemaValidator; use SilverStripe\GraphQL\Schema\Schema; -use SilverStripe\ORM\ArrayLib; +use SilverStripe\Core\ArrayLib; /** * Abstraction for enum types diff --git a/src/Schema/Type/ModelType.php b/src/Schema/Type/ModelType.php index 076828e2e..e8f0ac8e7 100644 --- a/src/Schema/Type/ModelType.php +++ b/src/Schema/Type/ModelType.php @@ -16,7 +16,7 @@ use SilverStripe\GraphQL\Schema\Interfaces\OperationProvider; use SilverStripe\GraphQL\Schema\Interfaces\SchemaModelInterface; use SilverStripe\GraphQL\Schema\Schema; -use SilverStripe\ORM\ArrayLib; +use SilverStripe\Core\ArrayLib; /** * A type that is generated by a model diff --git a/tests/Auth/HandlerTest.php b/tests/Auth/HandlerTest.php index f6da7fd68..86de5f018 100644 --- a/tests/Auth/HandlerTest.php +++ b/tests/Auth/HandlerTest.php @@ -69,7 +69,7 @@ public function testGetAuthenticator() */ public function testExceptionThrownWhenAuthenticatorDoesNotImplementAuthenticatorInterface() { - $this->expectException(\SilverStripe\ORM\ValidationException::class); + $this->expectException(\SilverStripe\Core\Validation\ValidationException::class); $this->expectExceptionMessage('stdClass must implement SilverStripe\\GraphQL\\Auth\\AuthenticatorInterface!'); Handler::config()->merge('authenticators', [['class' => 'stdClass']]); $this->handler->getAuthenticator(new HTTPRequest('GET', '/')); @@ -131,7 +131,7 @@ public static function prioritisedAuthenticatorProvider() */ public function testFailedAuthenticationThrowsException() { - $this->expectException(\SilverStripe\ORM\ValidationException::class); + $this->expectException(\SilverStripe\Core\Validation\ValidationException::class); $this->expectExceptionMessage('Never!'); Handler::config()->merge('authenticators', [['class' => BrutalAuthenticatorFake::class]]); $this->handler->requireAuthentication(new HTTPRequest('/', 'GET')); @@ -144,7 +144,7 @@ public function testFailedAuthenticationThrowsException() */ public function testFailedAuthenticationWithFalsyReturnValueThrowsDefaultException() { - $this->expectException(\SilverStripe\ORM\ValidationException::class); + $this->expectException(\SilverStripe\Core\Validation\ValidationException::class); $this->expectExceptionMessage('Authentication failed.'); Handler::config()->merge('authenticators', [['class' => FalsyAuthenticatorFake::class]]); $this->handler->requireAuthentication(new HTTPRequest('/', 'GET')); diff --git a/tests/Fake/BrutalAuthenticatorFake.php b/tests/Fake/BrutalAuthenticatorFake.php index d97e2ae7d..59281e4ff 100644 --- a/tests/Fake/BrutalAuthenticatorFake.php +++ b/tests/Fake/BrutalAuthenticatorFake.php @@ -5,7 +5,7 @@ use SilverStripe\Control\HTTPRequest; use SilverStripe\Dev\TestOnly; use SilverStripe\GraphQL\Auth\AuthenticatorInterface; -use SilverStripe\ORM\ValidationException; +use SilverStripe\Core\Validation\ValidationException; use SilverStripe\Security\Member; class BrutalAuthenticatorFake implements AuthenticatorInterface, TestOnly diff --git a/tests/Modules/AssetAdmin/ReadFileQueryCreatorTest.php b/tests/Modules/AssetAdmin/ReadFileQueryCreatorTest.php index 31760ca6f..5384fe4c8 100644 --- a/tests/Modules/AssetAdmin/ReadFileQueryCreatorTest.php +++ b/tests/Modules/AssetAdmin/ReadFileQueryCreatorTest.php @@ -78,7 +78,7 @@ public function testItFiltersResultsByCanView() /** * @param array $args * @param array $context - * @return \SilverStripe\ORM\DataList|\SilverStripe\ORM\Filterable + * @return \SilverStripe\ORM\DataList|\SilverStripe\Model\List\Filterable */ protected function getResultsForSearch($args, $context = null) { diff --git a/tests/Modules/Versioned/Plugins/VersionedDataObjectPluginTest.php b/tests/Modules/Versioned/Plugins/VersionedDataObjectPluginTest.php index 1a6c320fc..c27bca4e7 100644 --- a/tests/Modules/Versioned/Plugins/VersionedDataObjectPluginTest.php +++ b/tests/Modules/Versioned/Plugins/VersionedDataObjectPluginTest.php @@ -17,7 +17,7 @@ use SilverStripe\GraphQL\Schema\SchemaConfig; use SilverStripe\GraphQL\Schema\Type\ModelType; use SilverStripe\GraphQL\Schema\Type\Type; -use SilverStripe\ORM\SS_List; +use SilverStripe\Model\List\SS_List; use SilverStripe\Security\Member; use SilverStripe\Security\Security; use SilverStripe\GraphQL\Modules\Versioned\Operations\ReadVersions; diff --git a/tests/Schema/DataObject/Plugin/FiltersTest.php b/tests/Schema/DataObject/Plugin/FiltersTest.php index a98cc8b0c..dafa17987 100644 --- a/tests/Schema/DataObject/Plugin/FiltersTest.php +++ b/tests/Schema/DataObject/Plugin/FiltersTest.php @@ -14,7 +14,7 @@ use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters\LessThanOrEqualFilter; use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters\NotEqualFilter; use SilverStripe\GraphQL\Schema\DataObject\Plugin\QueryFilter\Filters\StartsWithFilter; -use SilverStripe\ORM\ArrayList; +use SilverStripe\Model\List\ArrayList; use PHPUnit\Framework\Attributes\DataProvider; class FiltersTest extends SapphireTest