1 | <?php |
||
16 | trait FormGroupTrait |
||
17 | { |
||
18 | /** |
||
19 | * Store a reference to the parent form widget. |
||
20 | * |
||
21 | * @var FormInterface |
||
22 | */ |
||
23 | protected $form; |
||
24 | |||
25 | /** |
||
26 | * The group's collection of fields. |
||
27 | * |
||
28 | * @var FormInputInterface[] |
||
29 | */ |
||
30 | private $inputs = []; |
||
31 | |||
32 | /** |
||
33 | * The input callback; called on every input. |
||
34 | * |
||
35 | * Callable signature: `function(FormInputInterface $input)` |
||
36 | * |
||
37 | * @var callable |
||
38 | */ |
||
39 | private $inputCallback; |
||
40 | |||
41 | /** |
||
42 | * Store the builder instance for the current class. |
||
43 | * |
||
44 | * @var FormInputBuilder |
||
45 | */ |
||
46 | protected $formInputBuilder; |
||
47 | |||
48 | /** |
||
49 | * The L10N display mode. |
||
50 | * |
||
51 | * @var string |
||
52 | */ |
||
53 | private $l10nMode; |
||
54 | |||
55 | /** |
||
56 | * The group's identifier. |
||
57 | * |
||
58 | * @var string |
||
59 | */ |
||
60 | private $ident; |
||
61 | |||
62 | /** |
||
63 | * The required Acl permissions fetch from form group. |
||
64 | * |
||
65 | * @var string[] $requiredAclPermissions |
||
66 | */ |
||
67 | private $requiredAclPermissions = []; |
||
68 | |||
69 | /** |
||
70 | * One or many CSS classes for tab form group. |
||
71 | * |
||
72 | * @var string |
||
73 | */ |
||
74 | private $tabCssClasses; |
||
75 | |||
76 | /** |
||
77 | * @var boolean |
||
78 | */ |
||
79 | private $isHidden; |
||
80 | |||
81 | /** |
||
82 | * @var array|null |
||
83 | */ |
||
84 | private $conditionalLogic; |
||
85 | |||
86 | /** |
||
87 | * Comparison function used by {@see uasort()}. |
||
88 | * |
||
89 | * @param PrioritizableInterface $a Sortable entity A. |
||
90 | * @param PrioritizableInterface $b Sortable entity B. |
||
91 | * @return integer Sorting value: -1 or 1. |
||
92 | */ |
||
93 | abstract protected function sortItemsByPriority( |
||
97 | |||
98 | /** |
||
99 | * @param FormInputBuilder $builder The builder, to create customized form input objects. |
||
100 | * @return FormGroupInterface Chainable |
||
101 | */ |
||
102 | protected function setFormInputBuilder(FormInputBuilder $builder) |
||
108 | |||
109 | /** |
||
110 | * @param callable $cb The input callback. |
||
111 | * @return FormGroupInterface Chainable |
||
112 | */ |
||
113 | public function setInputCallback(callable $cb) |
||
119 | |||
120 | /** |
||
121 | * @param FormInterface $form The parent form object. |
||
122 | * @return FormGroupInterface Chainable |
||
123 | */ |
||
124 | public function setForm(FormInterface $form) |
||
130 | |||
131 | /** |
||
132 | * @return FormInterface |
||
133 | */ |
||
134 | public function form() |
||
138 | |||
139 | /** |
||
140 | * @param string $mode The l10n mode. |
||
141 | * @return FormGroupInterface Chainable |
||
142 | */ |
||
143 | public function setL10nMode($mode) |
||
149 | |||
150 | /** |
||
151 | * @return string |
||
152 | */ |
||
153 | public function l10nMode() |
||
157 | |||
158 | /** |
||
159 | * @param array $inputs The group inputs. |
||
160 | * @return FormGroupInterface Chainable |
||
161 | */ |
||
162 | public function setInputs(array $inputs) |
||
171 | |||
172 | /** |
||
173 | * @param string $inputIdent The input identifier. |
||
174 | * @param array|FormInputInterface $input The input object or structure. |
||
175 | * @throws InvalidArgumentException If the ident argument is not a string or if the input is not valid. |
||
176 | * @return FormGroupInterface Chainable |
||
177 | */ |
||
178 | public function addInput($inputIdent, $input) |
||
201 | |||
202 | /** |
||
203 | * Form Input generator. |
||
204 | * |
||
205 | * @param callable $inputCallback Optional. Input callback. |
||
206 | * @return FormGroupInterface[]|Generator |
||
207 | */ |
||
208 | public function inputs(callable $inputCallback = null) |
||
226 | |||
227 | /** |
||
228 | * Wether this group contains any inputs. |
||
229 | * |
||
230 | * @return boolean |
||
231 | */ |
||
232 | public function hasInputs() |
||
236 | |||
237 | /** |
||
238 | * Get the number of inputs in this group. |
||
239 | * |
||
240 | * @return integer |
||
241 | */ |
||
242 | public function numInputs() |
||
246 | |||
247 | /** |
||
248 | * Set the identifier of the group. |
||
249 | * |
||
250 | * @param string $ident The group identifier. |
||
251 | * @return self |
||
252 | */ |
||
253 | public function setIdent($ident) |
||
259 | |||
260 | /** |
||
261 | * Retrieve the idenfitier of the group. |
||
262 | * |
||
263 | * @return string |
||
264 | */ |
||
265 | public function ident() |
||
269 | |||
270 | /** |
||
271 | * @param string|\string[] $classes Class or Classes for tab form group. |
||
272 | * @return self |
||
273 | */ |
||
274 | public function setTabCssClasses($classes) |
||
286 | |||
287 | /** |
||
288 | * @return string |
||
289 | */ |
||
290 | public function tabCssClasses() |
||
294 | |||
295 | /** |
||
296 | * @return boolean |
||
297 | */ |
||
298 | public function isHidden() |
||
302 | |||
303 | /** |
||
304 | * @param boolean $isHidden Hidden (TRUE) or shown (FALSE). |
||
305 | * @return self |
||
306 | */ |
||
307 | public function setIsHidden($isHidden) |
||
313 | |||
314 | /** |
||
315 | * @return array|null |
||
316 | */ |
||
317 | public function conditionalLogic() |
||
321 | |||
322 | /** |
||
323 | * @param array|null $conditionalLogic ConditionalLogic for FormGroupWidget. |
||
324 | * @return self |
||
325 | */ |
||
326 | public function setConditionalLogic($conditionalLogic) |
||
341 | } |
||
342 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.