1 | <?php |
||
16 | class Field |
||
17 | { |
||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | private $name; |
||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $type; |
||
26 | /** |
||
27 | * @var int |
||
28 | */ |
||
29 | private $length; |
||
30 | /** |
||
31 | * @var int |
||
32 | */ |
||
33 | private $minLength; |
||
34 | /** |
||
35 | * @var int |
||
36 | */ |
||
37 | private $maxLength; |
||
38 | /** |
||
39 | * @var string |
||
40 | */ |
||
41 | private $title; |
||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | private $description; |
||
46 | /** |
||
47 | * @var string |
||
48 | */ |
||
49 | private $exposeAs; |
||
50 | /** |
||
51 | * @var bool |
||
52 | */ |
||
53 | private $readOnly = false; |
||
54 | /** |
||
55 | * @var bool |
||
56 | */ |
||
57 | private $recordOriginException = false; |
||
58 | /** |
||
59 | * @var bool |
||
60 | */ |
||
61 | private $required = false; |
||
62 | /** |
||
63 | * @var integer |
||
64 | */ |
||
65 | private $searchable = 0; |
||
66 | /** |
||
67 | * @var bool |
||
68 | */ |
||
69 | private $translatable = false; |
||
70 | /** |
||
71 | * @var Constraint[] |
||
72 | */ |
||
73 | private $constraints = []; |
||
74 | |||
75 | /** |
||
76 | * @var array |
||
77 | */ |
||
78 | private $collection = []; |
||
79 | |||
80 | /** |
||
81 | * @var XDynamicKey |
||
82 | */ |
||
83 | private $xDynamicKey; |
||
84 | |||
85 | /** |
||
86 | * @return string |
||
87 | */ |
||
88 | 30 | public function getName() |
|
92 | |||
93 | /** |
||
94 | * @param string $name Field name |
||
95 | * @return $this |
||
96 | */ |
||
97 | 16 | public function setName($name) |
|
102 | |||
103 | /** |
||
104 | * @return string |
||
105 | */ |
||
106 | 80 | public function getType() |
|
110 | |||
111 | /** |
||
112 | * @param string $type Field type |
||
113 | * @return $this |
||
114 | */ |
||
115 | 58 | public function setType($type) |
|
120 | |||
121 | /** |
||
122 | * @return int |
||
123 | */ |
||
124 | 16 | public function getLength() |
|
128 | |||
129 | /** |
||
130 | * @param int $length Field length |
||
131 | * @return $this |
||
132 | */ |
||
133 | 4 | public function setLength($length) |
|
138 | |||
139 | /** |
||
140 | * @return int min length |
||
141 | */ |
||
142 | 16 | public function getMinLength() |
|
146 | |||
147 | /** |
||
148 | * @param int $minLength min length |
||
149 | * @return this |
||
|
|||
150 | */ |
||
151 | public function setMinLength($minLength) |
||
156 | |||
157 | /** |
||
158 | * @return int max length |
||
159 | */ |
||
160 | 16 | public function getMaxLength() |
|
164 | |||
165 | /** |
||
166 | * @param int $maxLength max length |
||
167 | * @return this |
||
168 | */ |
||
169 | public function setMaxLength($maxLength) |
||
174 | |||
175 | /** |
||
176 | * @return string |
||
177 | */ |
||
178 | 22 | public function getTitle() |
|
182 | |||
183 | /** |
||
184 | * @param string $title Field title |
||
185 | * @return $this |
||
186 | */ |
||
187 | 6 | public function setTitle($title) |
|
192 | |||
193 | /** |
||
194 | * @return string |
||
195 | */ |
||
196 | 22 | public function getDescription() |
|
200 | |||
201 | /** |
||
202 | * @param string $description Field description |
||
203 | * @return $this |
||
204 | */ |
||
205 | 12 | public function setDescription($description) |
|
210 | |||
211 | /** |
||
212 | * @return string |
||
213 | */ |
||
214 | 18 | public function getExposeAs() |
|
218 | |||
219 | /** |
||
220 | * @param string $exposeAs Expose field as ... |
||
221 | * @return $this |
||
222 | */ |
||
223 | 10 | public function setExposeAs($exposeAs) |
|
228 | |||
229 | /** |
||
230 | * @return bool |
||
231 | */ |
||
232 | 18 | public function getReadOnly() |
|
236 | |||
237 | /** |
||
238 | * @param bool $readOnly Is field readonly |
||
239 | * @return $this |
||
240 | */ |
||
241 | 6 | public function setReadOnly($readOnly) |
|
246 | |||
247 | /** |
||
248 | * get RecordOriginException |
||
249 | * |
||
250 | * @return boolean RecordOriginException |
||
251 | */ |
||
252 | 16 | public function isRecordOriginException() |
|
256 | |||
257 | /** |
||
258 | * set RecordOriginException |
||
259 | * |
||
260 | * @param boolean $recordOriginException recordOriginException |
||
261 | * |
||
262 | * @return void |
||
263 | */ |
||
264 | public function setRecordOriginException($recordOriginException) |
||
268 | |||
269 | /** |
||
270 | * @return bool |
||
271 | */ |
||
272 | 20 | public function getRequired() |
|
276 | |||
277 | /** |
||
278 | * @param bool $required Is field required |
||
279 | * @return $this |
||
280 | */ |
||
281 | 10 | public function setRequired($required) |
|
286 | |||
287 | /** |
||
288 | * @return bool |
||
289 | */ |
||
290 | 16 | public function getTranslatable() |
|
294 | |||
295 | /** |
||
296 | * @param bool $translatable Is field translatable |
||
297 | * @return $this |
||
298 | */ |
||
299 | 4 | public function setTranslatable($translatable) |
|
304 | |||
305 | /** |
||
306 | * @return Constraint[] |
||
307 | */ |
||
308 | 18 | public function getConstraints() |
|
312 | |||
313 | /** |
||
314 | * @param Constraint[] $constraints Field constraints |
||
315 | * @return $this |
||
316 | */ |
||
317 | 4 | public function setConstraints(array $constraints) |
|
322 | |||
323 | /** |
||
324 | * @return array |
||
325 | */ |
||
326 | 16 | public function getCollection() |
|
330 | |||
331 | /** |
||
332 | * @param array $collection Field |
||
333 | * @return $this |
||
334 | */ |
||
335 | 4 | public function setCollection(array $collection) |
|
340 | |||
341 | /** |
||
342 | * @return XDynamicKey |
||
343 | */ |
||
344 | 16 | public function getXDynamicKey() |
|
348 | |||
349 | /** |
||
350 | * @param XDynamicKey $xDynamicKey x-dynamic-key field value |
||
351 | * @return $this |
||
352 | */ |
||
353 | 2 | public function setXDynamicKey(XDynamicKey $xDynamicKey) |
|
358 | |||
359 | /** |
||
360 | * @return integer |
||
361 | */ |
||
362 | 18 | public function getSearchable() |
|
366 | |||
367 | /** |
||
368 | * @param integer $searchable searchable flag |
||
369 | * |
||
370 | * @return void |
||
371 | */ |
||
372 | public function setSearchable($searchable) |
||
376 | } |
||
377 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.