From dbb5a33cd0a029979b59d5fb3bf640df54053703 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 4 Dec 2024 10:46:02 +1300 Subject: [PATCH] API Deprecate renamed validator --- src/Forms/AWRequiredFields.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Forms/AWRequiredFields.php b/src/Forms/AWRequiredFields.php index 903a8ad1..5a2c53db 100644 --- a/src/Forms/AWRequiredFields.php +++ b/src/Forms/AWRequiredFields.php @@ -3,6 +3,7 @@ namespace Symbiote\AdvancedWorkflow\Forms; use SilverStripe\Forms\RequiredFields; +use SilverStripe\Dev\Deprecation; /** * Extends RequiredFields so we can prevent DO writes in AW's controller(s) without needing to catch Exceptions @@ -11,12 +12,21 @@ * * @author Russell Michell russell@silverstripe.com * @package advancedworkflow + * + * @deprecated 5.4.0 Will be renamed to Symbiote\AdvancedWorkflow\Forms\AWRequiredFieldsValidator */ class AWRequiredFields extends RequiredFields { protected $data = array(); protected static $caller; + public function __construct() + { + $message = 'Will be renamed to Symbiote\\AdvancedWorkflow\\Forms\\AWRequiredFieldsValidator'; + Deprecation::noticeWithNoReplacment('5.4.0', $message, Deprecation::SCOPE_CLASS); + parent::__construct(...func_get_args()); + } + public function php($data) { $valid = parent::php($data);