From ced3e6e28ee7c358fd442d45ed6bd50ed648e304 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 21 Aug 2024 09:23:36 +1200 Subject: [PATCH] API Replace Extension subclasses --- docs/en/scenarios.md | 4 ++-- src/Extension/FluentChangesExtension.php | 6 +++--- src/Extension/FluentExtension.php | 5 ++--- src/Extension/FluentFilteredExtension.php | 6 +++--- src/Extension/FluentIsolatedExtension.php | 6 +++--- src/Extension/FluentMemberExtension.php | 6 +++--- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/docs/en/scenarios.md b/docs/en/scenarios.md index 7b0ef5d0..d1270bb9 100644 --- a/docs/en/scenarios.md +++ b/docs/en/scenarios.md @@ -109,7 +109,7 @@ If you don't want to use the Filtered Locales Extension, then we can instead add namespace MySite\Extension\SiteTree; -use SilverStripe\CMS\Model\SiteTreeExtension; +use SilverStripe\Core\Extension; use SilverStripe\ORM\DataQuery; use SilverStripe\ORM\Queries\SQLSelect; use TractorCow\Fluent\State\FluentState; @@ -122,7 +122,7 @@ use TractorCow\Fluent\Model\Locale; * @property SiteTree|$this $owner * @mixin FluentExtension */ -class SiteTreeFluentExtension extends SiteTreeExtension +class SiteTreeFluentExtension extends Extension { /** * @param SQLSelect $query diff --git a/src/Extension/FluentChangesExtension.php b/src/Extension/FluentChangesExtension.php index 8198ff37..568089bf 100644 --- a/src/Extension/FluentChangesExtension.php +++ b/src/Extension/FluentChangesExtension.php @@ -2,15 +2,15 @@ namespace TractorCow\Fluent\Extension; -use SilverStripe\ORM\DataExtension; +use SilverStripe\Core\Extension; use SilverStripe\Versioned\ChangeSetItem; /** * Adds locale-specific extensions to ChangeSet * - * @extends DataExtension + * @extends Extension */ -class FluentChangesExtension extends DataExtension +class FluentChangesExtension extends Extension { /** * @see ChangeSetItem::getChangeType() diff --git a/src/Extension/FluentExtension.php b/src/Extension/FluentExtension.php index f329d74c..a076d9ab 100644 --- a/src/Extension/FluentExtension.php +++ b/src/Extension/FluentExtension.php @@ -13,7 +13,6 @@ use SilverStripe\Forms\GridField\GridField_ActionMenuItem; use SilverStripe\Forms\GridField\GridFieldConfig; use SilverStripe\ORM\ArrayList; -use SilverStripe\ORM\DataExtension; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataQuery; use SilverStripe\ORM\DB; @@ -48,9 +47,9 @@ * - data_include * * @template T of DataObject - * @extends DataExtension + * @extends Extension */ -class FluentExtension extends DataExtension +class FluentExtension extends Extension { /** * Deletions are managed via DeletePolicy diff --git a/src/Extension/FluentFilteredExtension.php b/src/Extension/FluentFilteredExtension.php index 5d59a6ac..944391f1 100644 --- a/src/Extension/FluentFilteredExtension.php +++ b/src/Extension/FluentFilteredExtension.php @@ -4,7 +4,7 @@ use SilverStripe\Forms\FieldList; use SilverStripe\Forms\GridField\GridFieldConfig; -use SilverStripe\ORM\DataExtension; +use SilverStripe\Core\Extension; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataQuery; use SilverStripe\ORM\ManyManyList; @@ -19,9 +19,9 @@ /** * @method ManyManyList FilteredLocales() * - * @extends DataExtension + * @extends Extension */ -class FluentFilteredExtension extends DataExtension +class FluentFilteredExtension extends Extension { /** * Deletions are managed via DeletePolicy diff --git a/src/Extension/FluentIsolatedExtension.php b/src/Extension/FluentIsolatedExtension.php index d3d68439..e49b991e 100644 --- a/src/Extension/FluentIsolatedExtension.php +++ b/src/Extension/FluentIsolatedExtension.php @@ -3,7 +3,7 @@ namespace TractorCow\Fluent\Extension; use LogicException; -use SilverStripe\ORM\DataExtension; +use SilverStripe\Core\Extension; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataQuery; use SilverStripe\ORM\DB; @@ -19,9 +19,9 @@ * @property int $LocaleID * @method Locale Locale() * - * @extends DataExtension + * @extends Extension */ -class FluentIsolatedExtension extends DataExtension +class FluentIsolatedExtension extends Extension { private static $has_one = [ 'Locale' => Locale::class, diff --git a/src/Extension/FluentMemberExtension.php b/src/Extension/FluentMemberExtension.php index 45a7b283..1e7300a7 100644 --- a/src/Extension/FluentMemberExtension.php +++ b/src/Extension/FluentMemberExtension.php @@ -3,7 +3,7 @@ namespace TractorCow\Fluent\Extension; use SilverStripe\ORM\ArrayList; -use SilverStripe\ORM\DataExtension; +use SilverStripe\Core\Extension; use SilverStripe\Security\Group; use SilverStripe\Security\Member; use SilverStripe\Security\Member_GroupSet; @@ -12,9 +12,9 @@ use TractorCow\Fluent\State\FluentState; /** - * @extends DataExtension + * @extends Extension */ -class FluentMemberExtension extends DataExtension +class FluentMemberExtension extends Extension { /** * Update groups