1: <?php
2:
3: namespace Charcoal\Validator;
4:
5: // Local namespace dependencies
6: use \Charcoal\Validator\ValidatorInterface as ValidatorInterface;
7:
8: /**
9: * Validatable Interface
10: *
11: * Add a validator to an object, as well as a `validate()` method.
12: */
13: interface ValidatableInterface
14: {
15: /**
16: * @param ValidatorInterface $validator The validator object to use for validation.
17: * @return ValidatableInterface Chainable
18: */
19: public function setValidator(ValidatorInterface $validator);
20:
21: /**
22: * @return ValidatorInterface
23: */
24: public function validator();
25:
26: /**
27: * @param ValidatorInterface $v Optional. A custom validator object to use for validation. If null, use object's.
28: * @return boolean
29: */
30: public function validate(ValidatorInterface &$v = null);
31: }
32: