1 | <?php |
||
25 | class Fieldset extends AbstractInput |
||
26 | { |
||
27 | /** |
||
28 | * |
||
29 | * A builder to create input objects. |
||
30 | * |
||
31 | * @var BuilderInterface |
||
32 | * |
||
33 | */ |
||
34 | protected $builder; |
||
35 | |||
36 | /** |
||
37 | * |
||
38 | * A filter for the fieldset values. |
||
39 | * |
||
40 | * @var FilterInterface |
||
41 | * |
||
42 | */ |
||
43 | protected $filter; |
||
44 | |||
45 | /** |
||
46 | * |
||
47 | * Inputs in the fieldset. |
||
48 | * |
||
49 | * @var array |
||
50 | * |
||
51 | */ |
||
52 | protected $inputs = []; |
||
53 | |||
54 | /** |
||
55 | * |
||
56 | * Object for retaining information about options available to the form |
||
57 | * inputs. |
||
58 | * |
||
59 | * @var mixed |
||
60 | * |
||
61 | */ |
||
62 | protected $options; |
||
63 | |||
64 | /** |
||
65 | * |
||
66 | * Property for storing the result of the last filter() call. |
||
67 | * |
||
68 | * @var bool |
||
69 | * |
||
70 | */ |
||
71 | protected $success; |
||
72 | |||
73 | /** |
||
74 | * |
||
75 | * Failures in the fieldset. |
||
76 | * |
||
77 | * @var FailureCollectionInterface |
||
78 | * |
||
79 | */ |
||
80 | protected $failures; |
||
81 | |||
82 | /** |
||
83 | * |
||
84 | * Constructor. |
||
85 | * |
||
86 | * @param BuilderInterface $builder An object to build input objects. |
||
87 | * |
||
88 | * @param FilterInterface $filter A filter object for this fieldset. |
||
89 | * |
||
90 | * @param object $options An arbitrary options object for use when setting |
||
91 | * up inputs and filters. |
||
92 | * |
||
93 | */ |
||
94 | public function __construct( |
||
104 | |||
105 | /** |
||
106 | * |
||
107 | * Gets an input value from this fieldset. |
||
108 | * |
||
109 | * @param string $name The input name. |
||
110 | * |
||
111 | * @return mixed The input value. |
||
112 | * |
||
113 | */ |
||
114 | public function __get($name) |
||
118 | |||
119 | /** |
||
120 | * |
||
121 | * Sets an input value on this fieldset. |
||
122 | * |
||
123 | * @param string $name The input name. |
||
124 | * |
||
125 | * @param mixed $value The input value. |
||
126 | * |
||
127 | * @return void |
||
128 | * |
||
129 | */ |
||
130 | public function __set($name, $value) |
||
134 | |||
135 | /** |
||
136 | * |
||
137 | * Checks if a value is set on an input in this fieldset. |
||
138 | * |
||
139 | * @param string $name The input name. |
||
140 | * |
||
141 | * @return bool |
||
142 | * |
||
143 | */ |
||
144 | public function __isset($name) |
||
152 | |||
153 | /** |
||
154 | * |
||
155 | * Sets the value of an input in this fieldset to null. |
||
156 | * |
||
157 | * @param string $name The input name. |
||
158 | * |
||
159 | * @return void |
||
160 | * |
||
161 | */ |
||
162 | public function __unset($name) |
||
168 | |||
169 | /** |
||
170 | * |
||
171 | * Returns the filter object. |
||
172 | * |
||
173 | * @return FilterInterface |
||
174 | * |
||
175 | */ |
||
176 | public function getFilter() |
||
180 | |||
181 | /** |
||
182 | * |
||
183 | * Returns an individual input object by name. |
||
184 | * |
||
185 | * @param string $name The name of the input object. |
||
186 | * |
||
187 | * @return AbstractInput |
||
188 | * |
||
189 | */ |
||
190 | public function getInput($name) |
||
200 | |||
201 | /** |
||
202 | * |
||
203 | * Returns the names of all input objects in this fieldset. |
||
204 | * |
||
205 | * @return array |
||
206 | * |
||
207 | */ |
||
208 | public function getInputNames() |
||
212 | |||
213 | /** |
||
214 | * |
||
215 | * Returns the input builder. |
||
216 | * |
||
217 | * @return BuilderInterface |
||
218 | * |
||
219 | */ |
||
220 | public function getBuilder() |
||
224 | |||
225 | /** |
||
226 | * |
||
227 | * Returns the options object |
||
228 | * |
||
229 | * @return mixed |
||
230 | * |
||
231 | */ |
||
232 | public function getOptions() |
||
236 | |||
237 | /** |
||
238 | * |
||
239 | * Fills this fieldset with input values. |
||
240 | * |
||
241 | * @param array $data The values for this fieldset. |
||
242 | * |
||
243 | * @return void |
||
244 | * |
||
245 | */ |
||
246 | public function fill(array $data) |
||
255 | |||
256 | /** |
||
257 | * |
||
258 | * Initializes the inputs and filter. |
||
259 | * |
||
260 | * @return void |
||
261 | * |
||
262 | */ |
||
263 | public function init() |
||
266 | |||
267 | /** |
||
268 | * |
||
269 | * Did the input data pass the filter rules? |
||
270 | * |
||
271 | * @return null|bool |
||
272 | * |
||
273 | */ |
||
274 | public function isSuccess() |
||
278 | |||
279 | /** |
||
280 | * |
||
281 | * Sets a new Field input. |
||
282 | * |
||
283 | * @param string $name The Field name. |
||
284 | * |
||
285 | * @param string $type A Field of this type; defaults to 'text'. |
||
286 | * |
||
287 | * @return Field |
||
288 | * |
||
289 | */ |
||
290 | public function setField($name, $type = null) |
||
295 | |||
296 | /** |
||
297 | * |
||
298 | * Sets a new Fieldset input. |
||
299 | * |
||
300 | * @param string $name The Fieldset name. |
||
301 | * |
||
302 | * @param string $type A Fieldset of this type; defaults to $name. |
||
303 | * |
||
304 | * @return Fieldset |
||
305 | * |
||
306 | */ |
||
307 | public function setFieldset($name, $type = null) |
||
312 | |||
313 | /** |
||
314 | * |
||
315 | * Sets a new Collection input. |
||
316 | * |
||
317 | * @param string $name The Collection name. |
||
318 | * |
||
319 | * @param string $type A Collection of this type of Fieldset; defaults to |
||
320 | * $name. |
||
321 | * |
||
322 | * @return Collection |
||
323 | * |
||
324 | */ |
||
325 | public function setCollection($name, $type = null) |
||
330 | |||
331 | /** |
||
332 | * |
||
333 | * Returns an input in a format suitable for a view. |
||
334 | * |
||
335 | * @param string $name The input name. |
||
336 | * |
||
337 | * @return mixed |
||
338 | * |
||
339 | */ |
||
340 | public function get($name = null) |
||
349 | |||
350 | /** |
||
351 | * |
||
352 | * Filters the inputs on this fieldset. |
||
353 | * |
||
354 | * @return bool True if all the filter rules pass, false if not. |
||
355 | * |
||
356 | */ |
||
357 | public function filter() |
||
378 | |||
379 | /** |
||
380 | * |
||
381 | * Returns the failures. |
||
382 | * |
||
383 | * @return FailureCollectionInterface |
||
384 | * |
||
385 | */ |
||
386 | public function getFailures() |
||
390 | |||
391 | /** |
||
392 | * |
||
393 | * Returns the value of this input for use in arrays. |
||
394 | * |
||
395 | * @return array |
||
396 | * |
||
397 | */ |
||
398 | public function getValue() |
||
406 | } |
||
407 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..