1: <?php
2: /**
3: * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
4: * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
5: *
6: * Licensed under The MIT License
7: * For full copyright and license information, please see the LICENSE.txt
8: * Redistributions of files must retain the above copyright notice.
9: *
10: * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
11: * @link http://cakephp.org CakePHP(tm) Project
12: * @since 3.5.0
13: * @license http://www.opensource.org/licenses/mit-license.php MIT License
14: */
15: namespace Cake\Validation;
16:
17: /**
18: * Provides methods for managing multiple validators.
19: */
20: interface ValidatorAwareInterface
21: {
22: /**
23: * Name of default validation set.
24: *
25: * @var string
26: */
27: const DEFAULT_VALIDATOR = 'default';
28:
29: /**
30: * Returns the validation rules tagged with $name.
31: *
32: * If a $name argument has not been provided, the default validator will be returned.
33: * You can configure your default validator name in a `DEFAULT_VALIDATOR`
34: * class constant.
35: *
36: * @param string|null $name The name of the validation set to return.
37: * @return \Cake\Validation\Validator
38: */
39: public function getValidator($name = null);
40:
41: /**
42: * This method stores a custom validator under the given name.
43: *
44: * @param string $name The name of a validator to be set.
45: * @param \Cake\Validation\Validator $validator Validator object to be set.
46: * @return $this
47: */
48: public function setValidator($name, Validator $validator);
49:
50: /**
51: * Checks whether or not a validator has been set.
52: *
53: * @param string $name The name of a validator.
54: * @return bool
55: */
56: public function hasValidator($name);
57: }
58: