From aafa484a30c541b31aa103a338f72fb83930ac2c Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Thu, 19 Dec 2024 16:07:40 +1300 Subject: [PATCH] API Add ValidationInterface to Form --- src/Forms/Form.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/Forms/Form.php b/src/Forms/Form.php index 7c540210bc2..440ba4b5224 100644 --- a/src/Forms/Form.php +++ b/src/Forms/Form.php @@ -12,6 +12,7 @@ use SilverStripe\Control\Session; use SilverStripe\Core\ClassInfo; use SilverStripe\Core\Injector\Injector; +use SilverStripe\Core\Validation\ValidationInterface; use SilverStripe\ORM\DataObjectInterface; use SilverStripe\ORM\FieldType\DBHTMLText; use SilverStripe\Core\Validation\ValidationResult; @@ -21,7 +22,6 @@ use SilverStripe\View\SSViewer; use SilverStripe\Model\ModelData; use SilverStripe\Forms\Validation\Validator; -use SilverStripe\Dev\Deprecation; /** * Base class for all forms. @@ -64,7 +64,7 @@ * For example, the "URLSegment" field in a standard CMS form would be * accessible through "admin/EditForm/field/URLSegment/FieldHolder". */ -class Form extends ModelData implements HasRequestHandler +class Form extends ModelData implements HasRequestHandler, ValidationInterface { use AttributesHTML; use FormMessage; @@ -1247,18 +1247,6 @@ public function getLegend() return $this->legend; } - /** - * Alias of validate() for backwards compatibility. - * - * @return ValidationResult - * @deprecated 5.4.0 Use validate() instead - */ - public function validationResult() - { - Deprecation::notice('5.4.0', 'Use validate() instead'); - return $this->validate(); - } - /** * Processing that occurs before a form is executed. *