1 | <?php |
||
9 | class GroupBuilder extends FieldBuilder |
||
10 | { |
||
11 | /** |
||
12 | * Used to contain and add fields |
||
13 | * @var FieldsBuilder |
||
14 | */ |
||
15 | protected $fieldsBuilder; |
||
16 | |||
17 | /** |
||
18 | * @param string $name Field name |
||
19 | * @param string $type Field name |
||
20 | * @param array $config Field configuration |
||
21 | */ |
||
22 | public function __construct($name, $type = 'group', $config = []) |
||
28 | |||
29 | /** |
||
30 | * Add multiple fields either via an array or from another builder |
||
31 | * @param array|FieldsBuilder $fields |
||
32 | * @return $this |
||
33 | */ |
||
34 | public function addFields($fields) |
||
39 | |||
40 | /** |
||
41 | * Return a group field configuration array |
||
42 | * @return array |
||
43 | */ |
||
44 | public function build() |
||
51 | |||
52 | /** |
||
53 | * Returns call chain to parentContext |
||
54 | * @return FieldBuilder |
||
55 | */ |
||
56 | public function endGroup() |
||
60 | |||
61 | /** |
||
62 | * Returns call chain to parentContext |
||
63 | * @return FieldBuilder |
||
64 | */ |
||
65 | public function end() |
||
69 | |||
70 | /** |
||
71 | * Intercept missing methods, pass any methods that begin with add to the |
||
72 | * internal fieldsBuilder |
||
73 | * @param string $method |
||
74 | * @param array $args |
||
75 | * @return mixed |
||
76 | */ |
||
77 | public function __call($method, $args) |
||
87 | |||
88 | /** |
||
89 | * Calls an add field method on the FieldsBuilder |
||
90 | * @param string $method [description] |
||
91 | * @param array $args |
||
92 | * @return FieldBuilder |
||
93 | */ |
||
94 | private function callAddFieldMethod($method, $args) |
||
98 | } |