diff --git a/docs/en/01_basic_usage.md b/docs/en/01_basic_usage.md index 1a37e5ed..a07c7505 100644 --- a/docs/en/01_basic_usage.md +++ b/docs/en/01_basic_usage.md @@ -116,13 +116,13 @@ class MyModel extends DataObject Custom links can have validation set using standard [model validation](https://docs.silverstripe.org/en/developer_guides/forms/validation/#model-validation). This is true both for the validation of the link data itself, as well as validating relations to the `Link` class. -For example you can make sure you have a link in your `has_one` or `has_many` relation using a [`RequiredFields`](api:SilverStripe\Forms\RequiredFields) validator: +For example you can make sure you have a link in your `has_one` or `has_many` relation using a [`RequiredFieldsValidator`](api:SilverStripe\Forms\RequiredFieldsValidator) validator: ```php namespace App\Model; use SilverStripe\Forms\CompositeValidator; -use SilverStripe\Forms\RequiredFields; +use SilverStripe\Forms\RequiredFieldsValidator; use SilverStripe\LinkField\Models\Link; use SilverStripe\ORM\DataObject; @@ -140,7 +140,7 @@ class MyModel extends DataObject public function getCMSCompositeValidator(): CompositeValidator { $validator = parent::getCMSCompositeValidator(); - $validator->addValidator(RequiredFields::create(['HasOneLink', 'HasManyLinks'])); + $validator->addValidator(RequiredFieldsValidator::create(['HasOneLink', 'HasManyLinks'])); return $validator; } } diff --git a/src/Models/EmailLink.php b/src/Models/EmailLink.php index 2a84053d..58aeaa16 100644 --- a/src/Models/EmailLink.php +++ b/src/Models/EmailLink.php @@ -5,7 +5,7 @@ use SilverStripe\Forms\EmailField; use SilverStripe\Forms\FieldList; use SilverStripe\Forms\CompositeValidator; -use SilverStripe\Forms\RequiredFields; +use SilverStripe\Forms\RequiredFieldsValidator; /** * A link to an Email address. @@ -39,7 +39,7 @@ public function getCMSFields(): FieldList public function getCMSCompositeValidator(): CompositeValidator { $validator = parent::getCMSCompositeValidator(); - $validator->addValidator(RequiredFields::create(['Email'])); + $validator->addValidator(RequiredFieldsValidator::create(['Email'])); return $validator; } diff --git a/src/Models/ExternalLink.php b/src/Models/ExternalLink.php index 306519e2..f52da14d 100644 --- a/src/Models/ExternalLink.php +++ b/src/Models/ExternalLink.php @@ -4,7 +4,7 @@ use SilverStripe\Forms\FieldList; use SilverStripe\Forms\CompositeValidator; -use SilverStripe\Forms\RequiredFields; +use SilverStripe\Forms\RequiredFieldsValidator; use SilverStripe\Forms\UrlField; /** @@ -41,7 +41,7 @@ public function getCMSFields(): FieldList public function getCMSCompositeValidator(): CompositeValidator { $validator = parent::getCMSCompositeValidator(); - $validator->addValidator(RequiredFields::create(['ExternalUrl'])); + $validator->addValidator(RequiredFieldsValidator::create(['ExternalUrl'])); return $validator; } diff --git a/src/Models/FileLink.php b/src/Models/FileLink.php index 22dbe175..4620a457 100644 --- a/src/Models/FileLink.php +++ b/src/Models/FileLink.php @@ -5,7 +5,7 @@ use SilverStripe\Assets\File; use SilverStripe\Forms\FieldList; use SilverStripe\Forms\CompositeValidator; -use SilverStripe\Forms\RequiredFields; +use SilverStripe\Forms\RequiredFieldsValidator; /** * A link to a File in the CMS @@ -37,7 +37,7 @@ public function getCMSFields(): FieldList public function getCMSCompositeValidator(): CompositeValidator { $validator = parent::getCMSCompositeValidator(); - $validator->addValidator(RequiredFields::create(['File'])); + $validator->addValidator(RequiredFieldsValidator::create(['File'])); return $validator; } diff --git a/src/Models/PhoneLink.php b/src/Models/PhoneLink.php index a89e9534..40d43d72 100644 --- a/src/Models/PhoneLink.php +++ b/src/Models/PhoneLink.php @@ -4,7 +4,7 @@ use SilverStripe\Forms\FieldList; use SilverStripe\Forms\CompositeValidator; -use SilverStripe\Forms\RequiredFields; +use SilverStripe\Forms\RequiredFieldsValidator; /** * A link to a phone number @@ -34,7 +34,7 @@ public function getCMSFields(): FieldList public function getCMSCompositeValidator(): CompositeValidator { $validator = parent::getCMSCompositeValidator(); - $validator->addValidator(RequiredFields::create(['Phone'])); + $validator->addValidator(RequiredFieldsValidator::create(['Phone'])); return $validator; } diff --git a/src/Models/SiteTreeLink.php b/src/Models/SiteTreeLink.php index b57a6a09..f96470d9 100644 --- a/src/Models/SiteTreeLink.php +++ b/src/Models/SiteTreeLink.php @@ -9,7 +9,7 @@ use SilverStripe\Forms\TextField; use SilverStripe\Forms\TreeDropdownField; use SilverStripe\Forms\CompositeValidator; -use SilverStripe\Forms\RequiredFields; +use SilverStripe\Forms\RequiredFieldsValidator; use SilverStripe\Forms\Tip; /** @@ -91,7 +91,7 @@ public function getCMSFields(): FieldList public function getCMSCompositeValidator(): CompositeValidator { $validator = parent::getCMSCompositeValidator(); - $validator->addValidator(RequiredFields::create(['PageID'])); + $validator->addValidator(RequiredFieldsValidator::create(['PageID'])); return $validator; }