TranslatableValidatorInterface
interface TranslatableValidatorInterface implements ValidatorInterface (View source)
Interface TranslatableValidatorInterface A modifier to the standard validator interface that enables translatable requirements and errors.
\@package Concrete\Core\Validator
Methods
Get the validator requirements in the form of an array keyed by it's respective error code.
Set the requirement string to a mixed value Closure format: function(TranslatableValidatorInterface $validator, int $code): string.
Set the error string to a string or to a closure Closure format: function(TranslatableValidatorInterface $validator, int $code, mixed $passed): string.
Details
string[]
getRequirementStrings()
Get the validator requirements in the form of an array keyed by it's respective error code.
Example: [ self::E_TOO_SHORT => 'Must be at least 10 characters' ]
bool
isValid(mixed $mixed, ArrayAccess $error = null)
Is this mixed value valid.
setRequirementString(int $code, string|Closure $message)
Set the requirement string to a mixed value Closure format: function(TranslatableValidatorInterface $validator, int $code): string.
setErrorString(int $code, string|Closure $message)
Set the error string to a string or to a closure Closure format: function(TranslatableValidatorInterface $validator, int $code, mixed $passed): string.
where $passed
is whatever was passed to ValidatorInterface::isValid