Skip to content

Commit

Permalink
Merge pull request #11347 from creative-commoners/pulls/5/deprecate-d…
Browse files Browse the repository at this point in the history
…ataextension

API Deprecate DataExtension
  • Loading branch information
GuySartorelli committed Aug 25, 2024
2 parents bf46ff9 + 743fe24 commit b13b657
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/ORM/DataExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,28 @@
use SilverStripe\ORM\Queries\SQLSelect;
use SilverStripe\Security\Member;
use Exception;
use SilverStripe\Dev\Deprecation;

/**
* An extension that adds additional functionality to a {@link DataObject}.
*
* @template T of DataObject
* @extends Extension<T>
* @deprecated 5.3.0 Subclass SilverStripe\Core\Extension\Extension instead
*/
abstract class DataExtension extends Extension
{
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 for extension-specific validation.
Expand Down

0 comments on commit b13b657

Please sign in to comment.