1 | <?php |
||
7 | abstract class FormValidator |
||
8 | { |
||
9 | |||
10 | private $isValid = true; |
||
11 | protected $inflictsFields = array(); |
||
12 | protected $errorMsg = ''; |
||
13 | |||
14 | /** |
||
15 | * @param string $errorMsg Error message to show if this validator returns false |
||
16 | * @param array $inflictsFields Array of fields to be marked "invalid" upon rendering the form if this validator |
||
17 | * evaluates to false |
||
18 | */ |
||
19 | public function __construct ($errorMsg, array $inflictsFields = array()) |
||
24 | |||
25 | public function getErrorMsg () |
||
29 | |||
30 | public function process (Form $form) |
||
41 | |||
42 | public function isValid () |
||
46 | |||
47 | public function isLive () |
||
51 | |||
52 | public abstract function validate (Form $form); |
||
53 | } |