PHP 클래스 Neos\Flow\Validation\Validator\AbstractValidator

상속: implements Neos\Flow\Validation\Validator\ValidatorInterface
파일 보기 프로젝트 열기: neos/flow-development-collection

보호된 프로퍼티들

프로퍼티 타입 설명
$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