Interface ValidatorAwareInterface

Provides methods for managing multiple validators.

Direct Implementers

Constants summary

Method Summary

  • Returns the validation rules tagged with $name.
  • Checks whether or not a validator has been set.
  • This method stores a custom validator under the given name.

Method Detail

getValidator()source public

getValidator( string|null $name null )

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 optional null
The name of the validation set to return.

Returns

Cake\Validation\Validator

hasValidator()source public

hasValidator( string $name )

Checks whether or not a validator has been set.

Parameters

string $name
The name of a validator.

Returns

boolean

setValidator()source public

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

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

© 2005–2017 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.4/class-Cake.Validation.ValidatorAwareInterface.html