| 1 | <?php |
||
| 14 | abstract class Field implements BaseField |
||
| 15 | { |
||
| 16 | const VAR_LIMIT = 'limit'; |
||
| 17 | |||
| 18 | const VAR_MATCH = 'match'; |
||
| 19 | |||
| 20 | const VAR_LOWER_LIMIT = 'lower'; |
||
| 21 | |||
| 22 | const VAR_UPPER_LIMIT = 'upper'; |
||
| 23 | |||
| 24 | const VAR_MESSAGE = 'message'; |
||
| 25 | |||
| 26 | const VAR_REGION = 'region'; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var string |
||
| 30 | */ |
||
| 31 | protected $name; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var mixed |
||
| 35 | */ |
||
| 36 | protected $value; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @var array |
||
| 40 | */ |
||
| 41 | protected $errors; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @var array |
||
| 45 | * array of Rule |
||
| 46 | */ |
||
| 47 | protected $rules = []; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @var bool |
||
| 51 | */ |
||
| 52 | protected $status; |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @var \PluginSimpleValidate\Contracts\RuleMapping |
||
| 56 | */ |
||
| 57 | protected $ruleMapping; |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Field constructor. |
||
| 61 | * @param string $name |
||
| 62 | * @param mixed $value |
||
| 63 | */ |
||
| 64 | 14 | public function __construct( |
|
| 72 | |||
| 73 | /** |
||
| 74 | * @return string |
||
| 75 | */ |
||
| 76 | 4 | public function getName(): string |
|
| 80 | |||
| 81 | /** |
||
| 82 | * @return array |
||
| 83 | */ |
||
| 84 | public function getRules(): array |
||
| 88 | |||
| 89 | /** |
||
| 90 | * @return array |
||
| 91 | */ |
||
| 92 | 11 | public function getErrors(): array |
|
| 96 | |||
| 97 | /** |
||
| 98 | * @return $this |
||
| 99 | */ |
||
| 100 | 12 | protected function emptyErrors() |
|
| 105 | } |