Skip to content

Commit

Permalink
API Add ValidationInterface to Form
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Dec 19, 2024
1 parent 313893b commit aafa484
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/Forms/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit aafa484

Please sign in to comment.