\Cake\ValidationValidatorAwareInterface

Provides methods for managing multiple validators.

Summary

Methods
Constants
getValidator()
setValidator()
hasValidator()
DEFAULT_VALIDATOR
No protected methods found
N/A
No private methods found
N/A

Constants

DEFAULT_VALIDATOR

DEFAULT_VALIDATOR = 'default' : string

Name of default validation set.

Methods

getValidator()

getValidator(string|null  $name = null) : \Cake\Validation\Validator

Returns the validation rules tagged with $name.

If a $name argument has not been provided, the default validator will be returned. You can configure your default validator name in a DEFAULT_VALIDATOR class constant.

Parameters

string|null $name

The name of the validation set to return.

Returns

\Cake\Validation\Validator

setValidator()

setValidator(string  $name, \Cake\Validation\Validator  $validator) : $this

This method stores a custom validator under the given name.

Parameters

string $name

The name of a validator to be set.

\Cake\Validation\Validator $validator

Validator object to be set.

Returns

$this

hasValidator()

hasValidator(string  $name) : boolean

Checks whether or not a validator has been set.

Parameters

string $name

The name of a validator.

Returns

boolean