From 497ea05d5d86e3e292c685bb441b435ce4086a6b Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 20 Aug 2024 14:11:53 +1200 Subject: [PATCH] API Deprecate LeftAndMainExtension --- code/Model/SiteTreeExtension.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/code/Model/SiteTreeExtension.php b/code/Model/SiteTreeExtension.php index e1b73a5c6e..6348a283eb 100644 --- a/code/Model/SiteTreeExtension.php +++ b/code/Model/SiteTreeExtension.php @@ -4,15 +4,29 @@ use SilverStripe\ORM\DataExtension; use SilverStripe\Security\Member; +use SilverStripe\Dev\Deprecation; +use SilverStripe\Core\Extension; /** * Plug-ins for additional functionality in your SiteTree classes. * * @template T of SiteTree * @extends DataExtension + * @deprecated 5.3.0 Subclass SilverStripe\Core\Extension\Extension instead */ abstract class SiteTreeExtension extends DataExtension { + public function __construct() + { + // Wrapping with Deprecation::withNoReplacement() to avoid triggering deprecation notices + // as we are unable to update existing subclasses of this class until a new major + // unless we add in the pointless empty methods that are in this class + Deprecation::withNoReplacement(function () { + $class = Extension::class; + Deprecation::notice('5.3.0', "Subclass $class instead", Deprecation::SCOPE_CLASS); + }); + parent::__construct(); + } /** * Hook called before the page's {@link Versioned::publishSingle()} action is completed