1 | <?php |
||
28 | class Rule |
||
29 | { |
||
30 | /** |
||
31 | * The regular expression to use in testing a form field value. |
||
32 | * |
||
33 | * @var string |
||
34 | * @since 1.0 |
||
35 | */ |
||
36 | protected $regex; |
||
37 | |||
38 | /** |
||
39 | * The regular expression modifiers to use when testing a form field value. |
||
40 | * |
||
41 | * @var string |
||
42 | * @since 1.0 |
||
43 | */ |
||
44 | protected $modifiers; |
||
45 | |||
46 | /** |
||
47 | * Method to test the value. |
||
48 | * |
||
49 | * @param SimpleXMLElement $element The SimpleXMLElement object representing the <field /> tag for the form field object. |
||
50 | * @param mixed $value The form field value to validate. |
||
51 | * @param string $group The field name group control value. This acts as as an array container for the field. |
||
52 | * For example if the field has name="foo" and the group value is set to "bar" then the |
||
53 | * full field name would end up being "bar[foo]". |
||
54 | * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. |
||
55 | * @param Form $form The form object for which the field is being tested. |
||
56 | * |
||
57 | * @return boolean True if the value is valid, false otherwise. |
||
58 | * |
||
59 | * @since 1.0 |
||
60 | * @throws UnexpectedValueException if rule is invalid. |
||
61 | */ |
||
62 | public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) |
||
84 | } |
||
85 |