1 | <?php |
||
9 | class FormRuleContext |
||
10 | { |
||
11 | /** |
||
12 | * @var RuleCollection[] { Key: form name, Value: RuleCollection[] } |
||
13 | */ |
||
14 | protected $rules = array(); |
||
15 | |||
16 | /** |
||
17 | * @var array { Key: form name, Value: array[] } |
||
18 | */ |
||
19 | protected $groups = array(); |
||
20 | |||
21 | /** |
||
22 | * @var string[] { Value: button name } |
||
23 | */ |
||
24 | protected $buttons = array(); |
||
25 | |||
26 | public function __construct(array $rules, array $groups, array $buttons) |
||
39 | |||
40 | /** |
||
41 | * Gets a rule list by name. |
||
42 | * |
||
43 | * @param string $name The form full_name |
||
44 | * @return RuleCollection|null A array of Rule instances or null when not found |
||
45 | */ |
||
46 | public function get($name) |
||
50 | |||
51 | /** |
||
52 | * Returns all rules in this collection. |
||
53 | * |
||
54 | * @return RuleCollection[] An array of rules |
||
55 | */ |
||
56 | public function all() |
||
60 | |||
61 | public function getGroups() |
||
65 | |||
66 | /** |
||
67 | * @param $name |
||
68 | * @return null|array |
||
69 | */ |
||
70 | public function getGroup($name) |
||
74 | |||
75 | public function getButtons() |
||
79 | |||
80 | protected function isValidGroup($value) |
||
92 | } |
||
93 |