From b8265161e515aae66e719867ba06fdc5a9984385 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 29 Oct 2024 17:57:25 +1300 Subject: [PATCH] API Use updated Versioned and Staged classes --- .../01_adding_dataobjects_to_the_schema.md | 4 ++-- src/Controller.php | 2 +- src/Modules/AssetAdmin/Resolvers/AssetAdminResolver.php | 2 +- src/Modules/AssetAdmin/Resolvers/FolderTypeResolver.php | 2 +- src/Modules/AssetAdmin/Resolvers/PublicationResolver.php | 4 ++-- .../Versioned/Operations/AbstractPublishOperationCreator.php | 2 +- src/Modules/Versioned/Operations/CopyToStageCreator.php | 2 +- src/Modules/Versioned/Operations/RollbackCreator.php | 2 +- src/Modules/Versioned/Plugins/UnpublishOnDelete.php | 2 +- src/Modules/Versioned/Plugins/VersionedDataObject.php | 2 +- src/Modules/Versioned/Plugins/VersionedRead.php | 2 +- src/Modules/Versioned/Resolvers/VersionFilters.php | 2 +- src/Modules/Versioned/Resolvers/VersionedResolver.php | 2 +- tests/Fake/FakeProduct.php | 2 +- tests/Fake/FakeReview.php | 2 +- tests/Fake/FakeSiteTree.php | 2 +- .../AssetAdmin/UnpublishFileMutationCreatorTest/FileOwner.php | 4 ++-- tests/Modules/Versioned/Fake/Fake.php | 4 ++-- tests/Modules/Versioned/Fake/FakeDataObjectStub.php | 2 +- .../Versioned/Plugins/VersionedDataObjectPluginTest.php | 2 +- tests/Modules/Versioned/Plugins/VersionedReadTest.php | 2 +- tests/Modules/Versioned/Resolvers/VersionedFiltersTest.php | 2 +- tests/Modules/Versioned/Resolvers/VersionedResolverTest.php | 2 +- 23 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/en/02_working_with_dataobjects/01_adding_dataobjects_to_the_schema.md b/docs/en/02_working_with_dataobjects/01_adding_dataobjects_to_the_schema.md index 715fa63a7..12532812a 100644 --- a/docs/en/02_working_with_dataobjects/01_adding_dataobjects_to_the_schema.md +++ b/docs/en/02_working_with_dataobjects/01_adding_dataobjects_to_the_schema.md @@ -248,7 +248,7 @@ app: - App\Model\* extensionLoader: include: - - SilverStripe\Versioned\Versioned + - SilverStripe\Versioned\Mode\Versioned filepathLoader: exclude: - app/src/Model/*.secret.php @@ -277,7 +277,7 @@ By default, four loaders are provided to you to help gather specific classnames: - **Identifier**: `extensionLoader` - **Description**: Include or exclude any class that has a given extension applied -- **Example**: `include: [SilverStripe\Versioned\Versioned]` +- **Example**: `include: [SilverStripe\Versioned\Mode\Versioned]` #### By filepath diff --git a/src/Controller.php b/src/Controller.php index 0683eb5e6..d74288fbc 100644 --- a/src/Controller.php +++ b/src/Controller.php @@ -28,7 +28,7 @@ use SilverStripe\GraphQL\Schema\SchemaBuilder; use SilverStripe\Security\Member; use SilverStripe\Security\Permission; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; use BadMethodCallException; use SilverStripe\Dev\Backtrace; use SilverStripe\Core\ClassInfo; diff --git a/src/Modules/AssetAdmin/Resolvers/AssetAdminResolver.php b/src/Modules/AssetAdmin/Resolvers/AssetAdminResolver.php index d09de0717..2d1c46b91 100644 --- a/src/Modules/AssetAdmin/Resolvers/AssetAdminResolver.php +++ b/src/Modules/AssetAdmin/Resolvers/AssetAdminResolver.php @@ -14,7 +14,7 @@ use SilverStripe\GraphQL\Schema\DataObject\FieldAccessor; use SilverStripe\ORM\DataList; use SilverStripe\Model\List\Filterable; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; use InvalidArgumentException; class AssetAdminResolver diff --git a/src/Modules/AssetAdmin/Resolvers/FolderTypeResolver.php b/src/Modules/AssetAdmin/Resolvers/FolderTypeResolver.php index 71a1658cb..95ad2bfb1 100644 --- a/src/Modules/AssetAdmin/Resolvers/FolderTypeResolver.php +++ b/src/Modules/AssetAdmin/Resolvers/FolderTypeResolver.php @@ -14,7 +14,7 @@ use SilverStripe\ORM\DataList; use SilverStripe\ORM\DB; use SilverStripe\Model\List\Sortable; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; use InvalidArgumentException; use Exception; use Closure; diff --git a/src/Modules/AssetAdmin/Resolvers/PublicationResolver.php b/src/Modules/AssetAdmin/Resolvers/PublicationResolver.php index f3ecbcf1b..42b0548d0 100644 --- a/src/Modules/AssetAdmin/Resolvers/PublicationResolver.php +++ b/src/Modules/AssetAdmin/Resolvers/PublicationResolver.php @@ -8,8 +8,8 @@ use SilverStripe\Assets\File; use SilverStripe\GraphQL\QueryHandler\QueryHandler; use SilverStripe\GraphQL\QueryHandler\UserContextProvider; -use SilverStripe\Versioned\RecursivePublishable; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Staged\RecursivePublishable; +use SilverStripe\Versioned\Mode\Versioned; use InvalidArgumentException; class PublicationResolver diff --git a/src/Modules/Versioned/Operations/AbstractPublishOperationCreator.php b/src/Modules/Versioned/Operations/AbstractPublishOperationCreator.php index 6ea483c5d..e9a5bc0d0 100644 --- a/src/Modules/Versioned/Operations/AbstractPublishOperationCreator.php +++ b/src/Modules/Versioned/Operations/AbstractPublishOperationCreator.php @@ -21,7 +21,7 @@ use SilverStripe\Core\Validation\ValidationException; use SilverStripe\Security\Member; use SilverStripe\GraphQL\Modules\Versioned\Resolvers\VersionedResolver; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; use SilverStripe\Model\ModelData; // GraphQL dependency is optional in versioned, diff --git a/src/Modules/Versioned/Operations/CopyToStageCreator.php b/src/Modules/Versioned/Operations/CopyToStageCreator.php index 624d40e86..bfbf5d993 100644 --- a/src/Modules/Versioned/Operations/CopyToStageCreator.php +++ b/src/Modules/Versioned/Operations/CopyToStageCreator.php @@ -11,7 +11,7 @@ use SilverStripe\GraphQL\Schema\Interfaces\OperationCreator; use SilverStripe\GraphQL\Schema\Interfaces\SchemaModelInterface; use SilverStripe\GraphQL\Modules\Versioned\Resolvers\VersionedResolver; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; use SilverStripe\Model\ModelData; // GraphQL dependency is optional in versioned, diff --git a/src/Modules/Versioned/Operations/RollbackCreator.php b/src/Modules/Versioned/Operations/RollbackCreator.php index 41faf3812..f820ffbb1 100644 --- a/src/Modules/Versioned/Operations/RollbackCreator.php +++ b/src/Modules/Versioned/Operations/RollbackCreator.php @@ -10,7 +10,7 @@ use SilverStripe\GraphQL\Schema\Interfaces\OperationCreator; use SilverStripe\GraphQL\Schema\Interfaces\SchemaModelInterface; use SilverStripe\GraphQL\Modules\Versioned\Resolvers\VersionedResolver; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; use SilverStripe\Model\ModelData; // GraphQL dependency is optional in versioned, diff --git a/src/Modules/Versioned/Plugins/UnpublishOnDelete.php b/src/Modules/Versioned/Plugins/UnpublishOnDelete.php index dcaae6adb..c63b416ec 100644 --- a/src/Modules/Versioned/Plugins/UnpublishOnDelete.php +++ b/src/Modules/Versioned/Plugins/UnpublishOnDelete.php @@ -11,7 +11,7 @@ use SilverStripe\ORM\DataList; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DB; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; use Exception; use Closure; use SilverStripe\Model\ModelData; diff --git a/src/Modules/Versioned/Plugins/VersionedDataObject.php b/src/Modules/Versioned/Plugins/VersionedDataObject.php index 6f1864fbd..d5cffbb0f 100644 --- a/src/Modules/Versioned/Plugins/VersionedDataObject.php +++ b/src/Modules/Versioned/Plugins/VersionedDataObject.php @@ -20,7 +20,7 @@ use SilverStripe\Model\List\Sortable; use SilverStripe\Security\Member; use SilverStripe\GraphQL\Modules\Versioned\Resolvers\VersionedResolver; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; use Closure; use SilverStripe\Model\ModelData; diff --git a/src/Modules/Versioned/Plugins/VersionedRead.php b/src/Modules/Versioned/Plugins/VersionedRead.php index 5dea93f4b..3e376eb50 100644 --- a/src/Modules/Versioned/Plugins/VersionedRead.php +++ b/src/Modules/Versioned/Plugins/VersionedRead.php @@ -7,7 +7,7 @@ use SilverStripe\GraphQL\Schema\Interfaces\ModelQueryPlugin; use SilverStripe\GraphQL\Schema\Schema; use SilverStripe\GraphQL\Modules\Versioned\Resolvers\VersionedResolver; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; use SilverStripe\Model\ModelData; // GraphQL dependency is optional in versioned, diff --git a/src/Modules/Versioned/Resolvers/VersionFilters.php b/src/Modules/Versioned/Resolvers/VersionFilters.php index 24a3b0945..08a887b27 100644 --- a/src/Modules/Versioned/Resolvers/VersionFilters.php +++ b/src/Modules/Versioned/Resolvers/VersionFilters.php @@ -5,7 +5,7 @@ use SilverStripe\ORM\DataList; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\RelationList; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; use InvalidArgumentException; use DateTime; diff --git a/src/Modules/Versioned/Resolvers/VersionedResolver.php b/src/Modules/Versioned/Resolvers/VersionedResolver.php index 7a7a3d5f3..1a18cf3ec 100644 --- a/src/Modules/Versioned/Resolvers/VersionedResolver.php +++ b/src/Modules/Versioned/Resolvers/VersionedResolver.php @@ -17,7 +17,7 @@ use SilverStripe\GraphQL\Modules\Versioned\Operations\RollbackCreator; use SilverStripe\GraphQL\Modules\Versioned\Plugins\VersionedDataObject; use SilverStripe\GraphQL\Modules\Versioned\Plugins\VersionedRead; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; use Exception; use Closure; use InvalidArgumentException; diff --git a/tests/Fake/FakeProduct.php b/tests/Fake/FakeProduct.php index ad927f582..0138bbcae 100644 --- a/tests/Fake/FakeProduct.php +++ b/tests/Fake/FakeProduct.php @@ -5,7 +5,7 @@ use SilverStripe\Dev\TestOnly; use SilverStripe\ORM\DataObject; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; class FakeProduct extends DataObject implements TestOnly { diff --git a/tests/Fake/FakeReview.php b/tests/Fake/FakeReview.php index 7057fca85..acfb46970 100644 --- a/tests/Fake/FakeReview.php +++ b/tests/Fake/FakeReview.php @@ -6,7 +6,7 @@ use SilverStripe\Dev\TestOnly; use SilverStripe\ORM\DataObject; use SilverStripe\Security\Member; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; class FakeReview extends DataObject implements TestOnly { diff --git a/tests/Fake/FakeSiteTree.php b/tests/Fake/FakeSiteTree.php index 99712a181..b5b4278ec 100644 --- a/tests/Fake/FakeSiteTree.php +++ b/tests/Fake/FakeSiteTree.php @@ -4,7 +4,7 @@ use SilverStripe\Dev\TestOnly; use SilverStripe\ORM\DataObject; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; class FakeSiteTree extends DataObject implements TestOnly { diff --git a/tests/Modules/AssetAdmin/UnpublishFileMutationCreatorTest/FileOwner.php b/tests/Modules/AssetAdmin/UnpublishFileMutationCreatorTest/FileOwner.php index 5005fdbd8..f3be4f9cc 100644 --- a/tests/Modules/AssetAdmin/UnpublishFileMutationCreatorTest/FileOwner.php +++ b/tests/Modules/AssetAdmin/UnpublishFileMutationCreatorTest/FileOwner.php @@ -5,8 +5,8 @@ use SilverStripe\Assets\File; use SilverStripe\Dev\TestOnly; use SilverStripe\ORM\DataObject; -use SilverStripe\Versioned\RecursivePublishable; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Staged\RecursivePublishable; +use SilverStripe\Versioned\Mode\Versioned; /** * @mixin RecursivePublishable diff --git a/tests/Modules/Versioned/Fake/Fake.php b/tests/Modules/Versioned/Fake/Fake.php index a7037d277..55c99960a 100644 --- a/tests/Modules/Versioned/Fake/Fake.php +++ b/tests/Modules/Versioned/Fake/Fake.php @@ -4,8 +4,8 @@ use SilverStripe\Dev\TestOnly; use SilverStripe\ORM\DataObject; -use SilverStripe\Versioned\RecursivePublishable; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Staged\RecursivePublishable; +use SilverStripe\Versioned\Mode\Versioned; /** * @property string $Name diff --git a/tests/Modules/Versioned/Fake/FakeDataObjectStub.php b/tests/Modules/Versioned/Fake/FakeDataObjectStub.php index 602d82f66..641a0bca7 100644 --- a/tests/Modules/Versioned/Fake/FakeDataObjectStub.php +++ b/tests/Modules/Versioned/Fake/FakeDataObjectStub.php @@ -3,7 +3,7 @@ use SilverStripe\Dev\TestOnly; use SilverStripe\ORM\DataObject; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; class FakeDataObjectStub extends DataObject implements TestOnly { diff --git a/tests/Modules/Versioned/Plugins/VersionedDataObjectPluginTest.php b/tests/Modules/Versioned/Plugins/VersionedDataObjectPluginTest.php index c27bca4e7..3a7e16899 100644 --- a/tests/Modules/Versioned/Plugins/VersionedDataObjectPluginTest.php +++ b/tests/Modules/Versioned/Plugins/VersionedDataObjectPluginTest.php @@ -26,7 +26,7 @@ use SilverStripe\GraphQL\Modules\Versioned\Types\VersionedStage; use SilverStripe\GraphQL\Tests\Modules\Versioned\Fake\Fake; use SilverStripe\GraphQL\Tests\Modules\Versioned\Plugins\UnversionedWithField; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; // Versioned dependency is optional // and the following implementation relies on existence of this class (in Versioned) diff --git a/tests/Modules/Versioned/Plugins/VersionedReadTest.php b/tests/Modules/Versioned/Plugins/VersionedReadTest.php index 46ffc3415..5e45c2edc 100644 --- a/tests/Modules/Versioned/Plugins/VersionedReadTest.php +++ b/tests/Modules/Versioned/Plugins/VersionedReadTest.php @@ -24,7 +24,7 @@ use SilverStripe\GraphQL\Modules\Versioned\Resolvers\VersionedResolver; use SilverStripe\GraphQL\Modules\Versioned\Types\VersionedInputType; use SilverStripe\GraphQL\Tests\Modules\Versioned\Fake\Fake; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; // Versioned dependency is optional // and the following implementation relies on existence of this class (in Versioned) diff --git a/tests/Modules/Versioned/Resolvers/VersionedFiltersTest.php b/tests/Modules/Versioned/Resolvers/VersionedFiltersTest.php index e0b361d85..8b2dbaf20 100644 --- a/tests/Modules/Versioned/Resolvers/VersionedFiltersTest.php +++ b/tests/Modules/Versioned/Resolvers/VersionedFiltersTest.php @@ -5,7 +5,7 @@ use SilverStripe\Dev\SapphireTest; use SilverStripe\GraphQL\Resolvers\VersionFilters; use SilverStripe\GraphQL\Tests\Modules\Versioned\Fake\Fake; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; // Versioned dependency is optional // and the following implementation relies on existence of this class (in Versioned) diff --git a/tests/Modules/Versioned/Resolvers/VersionedResolverTest.php b/tests/Modules/Versioned/Resolvers/VersionedResolverTest.php index 4022f5581..c2395e042 100644 --- a/tests/Modules/Versioned/Resolvers/VersionedResolverTest.php +++ b/tests/Modules/Versioned/Resolvers/VersionedResolverTest.php @@ -9,7 +9,7 @@ use SilverStripe\Security\Member; use SilverStripe\Dev\SapphireTest; use SilverStripe\Security\Security; -use SilverStripe\Versioned\Versioned; +use SilverStripe\Versioned\Mode\Versioned; use SilverStripe\GraphQL\Schema\Schema; use GraphQL\Type\Definition\ResolveInfo; use SilverStripe\GraphQL\Tests\Modules\Versioned\Fake\Fake;