PHP Класс Neos\Flow\Validation\Validator\AbstractValidator

Наследование: implements Neos\Flow\Validation\Validator\ValidatorInterface
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$acceptsEmptyValues boolean If this is TRUE, the validators isValid() method is not called in case of an empty value Note: A value is considered empty if it is NULL or an empty string! By default all validators except for NotEmpty and the Composite Validators accept empty values
$options array
$result Neos\Error\Messages\Result
$supportedOptions array 0 => default value 1 => description 2 => type 3 => required (boolean, optional)

Открытые методы

Метод Описание
__construct ( array $options = [] ) Constructs the validator and sets validation options
getOptions ( ) : array Returns the options of this validator
validate ( mixed $value ) : Neos\Error\Messages\Result Checks if the given value is valid according to the validator, and returns the Error Messages object which occurred.

Защищенные методы

Метод Описание
addError ( string $message, integer $code, array $arguments = [] ) : void Creates a new validation error object and adds it to $this->errors
isEmpty ( mixed $value ) : boolean
isValid ( mixed $value ) : void Check if $value is valid. If it is not valid, needs to add an error to Result.

Описание методов

__construct() публичный Метод

Constructs the validator and sets validation options
public __construct ( array $options = [] )
$options array Options for the validator

addError() защищенный Метод

Creates a new validation error object and adds it to $this->errors
protected addError ( string $message, integer $code, array $arguments = [] ) : void
$message string The error message
$code integer The error code (a unix timestamp)
$arguments array Arguments to be replaced in message
Результат void

getOptions() публичный Метод

Returns the options of this validator
public getOptions ( ) : array
Результат array

isEmpty() закрытый защищенный Метод

final protected isEmpty ( mixed $value ) : boolean
$value mixed
Результат boolean TRUE if the given $value is NULL or an empty string ('')

isValid() абстрактный защищенный Метод

Check if $value is valid. If it is not valid, needs to add an error to Result.
abstract protected isValid ( mixed $value ) : void
$value mixed
Результат void

validate() публичный Метод

Checks if the given value is valid according to the validator, and returns the Error Messages object which occurred.
public validate ( mixed $value ) : Neos\Error\Messages\Result
$value mixed The value that should be validated
Результат Neos\Error\Messages\Result

Описание свойств

$acceptsEmptyValues защищенное свойство

If this is TRUE, the validators isValid() method is not called in case of an empty value Note: A value is considered empty if it is NULL or an empty string! By default all validators except for NotEmpty and the Composite Validators accept empty values
protected bool $acceptsEmptyValues
Результат boolean

$options защищенное свойство

protected array $options
Результат array

$result защищенное свойство

protected Result,Neos\Error\Messages $result
Результат Neos\Error\Messages\Result

$supportedOptions защищенное свойство

0 => default value 1 => description 2 => type 3 => required (boolean, optional)
protected array $supportedOptions
Результат array