1: <?php
2:
3: namespace Charcoal\Validator;
4:
5: /**
6: * A validator is attached to a model that implements ValidatableInterface and validate an object.
7: */
8: interface ValidatorInterface
9: {
10: /**
11: * @param string $msg The error message.
12: * @return ValidatorInterface Chainable
13: */
14: public function error($msg);
15:
16: /**
17: * @param string $msg The warning message.
18: * @return ValidatorInterface Chainable
19: */
20: public function warning($msg);
21: /**
22: * @param string $msg The notice message.
23: * @return ValidatorInterface Chainable
24: */
25: public function notice($msg);
26:
27: /**
28: * @param string $level The log level ('error', 'warning' or 'notice').
29: * @param string $msg The message.
30: * @return ValidatorInterface Chainable
31: */
32: public function log($level, $msg);
33:
34: /**
35: * @return array
36: */
37: public function results();
38:
39: /**
40: * @return boolean
41: */
42: public function validate();
43: }
44: