1 | <?php |
||
8 | class ValidationAdaptor implements validationProviderInterface |
||
9 | { |
||
10 | /** |
||
11 | * Holds the rule name in operation. |
||
12 | */ |
||
13 | private $ruleName; |
||
14 | |||
15 | /** |
||
16 | * Holds the arguments for the rule. |
||
17 | */ |
||
18 | private $arguments; |
||
19 | |||
20 | /** |
||
21 | * Validator object. |
||
22 | */ |
||
23 | private $validator; |
||
24 | |||
25 | /** |
||
26 | * Validation mapping. |
||
27 | */ |
||
28 | private static $validatorMapping = []; |
||
29 | |||
30 | /** |
||
31 | * Set the validator object. |
||
32 | */ |
||
33 | public function __construct($validator) |
||
42 | |||
43 | /** |
||
44 | * @param string $ruleName The rule name. |
||
45 | * @param array $arguments The arguments for the rule. |
||
46 | */ |
||
47 | public function rule($ruleName, array $arguments = []) |
||
54 | |||
55 | /** |
||
56 | * @param mixed $value |
||
57 | */ |
||
58 | public function validate($value) |
||
69 | |||
70 | /** |
||
71 | * Get mapped method. |
||
72 | * |
||
73 | * @param string $method The validation method to map. |
||
74 | * |
||
75 | * @return string |
||
76 | */ |
||
77 | public function getMappedMethod($method) |
||
89 | } |
||
90 |