1 | <?php |
||
25 | class MatchField extends AbstractRule |
||
26 | { |
||
27 | |||
28 | /** |
||
29 | * Contains the rule failure message |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $message = 'The field does not match the other given field.'; |
||
34 | |||
35 | /** |
||
36 | * Returns true if $value matches the value of the field specified with setParameter() |
||
37 | * |
||
38 | * @param mixed $value Value to validate |
||
39 | * @param string $field Name of the field that is being validated |
||
40 | * @param array $allFields Values of all the other fields being validated |
||
41 | * |
||
42 | * @return bool |
||
43 | * |
||
44 | * @since 2.0 |
||
45 | */ |
||
46 | 5 | public function validate($value, $field = null, $allFields = null) |
|
59 | |||
60 | /** |
||
61 | * Sets the field name to match against |
||
62 | * |
||
63 | * @param string $params If an array the first value will be used |
||
64 | * |
||
65 | * @return $this |
||
66 | * |
||
67 | * @since 2.0 |
||
68 | */ |
||
69 | 9 | public function setParameter($params) |
|
79 | |||
80 | /** |
||
81 | * Returns |
||
82 | * |
||
83 | * array( |
||
84 | * 'field' => <field that will be matched against> |
||
85 | * ); |
||
86 | * |
||
87 | * @return string[] |
||
88 | */ |
||
89 | 1 | public function getMessageParameters() |
|
95 | |||
96 | } |
||
97 |