1 | <?php |
||
28 | class WidgetModel implements WidgetModelInterface, TimestampableInterface, PersistableInterface |
||
29 | { |
||
30 | /** |
||
31 | * @var int |
||
32 | */ |
||
33 | protected $id; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $type; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $name; |
||
44 | |||
45 | /** |
||
46 | * @var bool |
||
47 | */ |
||
48 | protected $visible; |
||
49 | |||
50 | /** |
||
51 | * @var [] |
||
52 | */ |
||
53 | protected $parameters; |
||
54 | |||
55 | /** |
||
56 | * @var ArrayCollection |
||
57 | */ |
||
58 | protected $containers; |
||
59 | |||
60 | /** |
||
61 | * @var \DateTime |
||
62 | */ |
||
63 | protected $createdAt; |
||
64 | |||
65 | /** |
||
66 | * @var \DateTime |
||
67 | */ |
||
68 | protected $updatedAt = null; |
||
69 | |||
70 | /** |
||
71 | * WidgetModel constructor. |
||
72 | */ |
||
73 | public function __construct() |
||
80 | |||
81 | 14 | /** |
|
82 | 14 | * {@inheritdoc} |
|
83 | 14 | */ |
|
84 | 14 | public function getTypes(): array |
|
92 | 8 | ||
93 | /** |
||
94 | 8 | * Get id. |
|
95 | * |
||
96 | * @return int |
||
97 | */ |
||
98 | public function getId() |
||
102 | |||
103 | /** |
||
104 | * Set id. |
||
105 | * |
||
106 | * @param string $id |
||
107 | * |
||
108 | * @return WidgetModel |
||
109 | */ |
||
110 | public function setId($id) |
||
116 | |||
117 | /** |
||
118 | 14 | * Set name. |
|
119 | * |
||
120 | 14 | * @param string $name |
|
121 | * |
||
122 | 14 | * @return WidgetModel |
|
123 | */ |
||
124 | public function setName($name) |
||
130 | 3 | ||
131 | /** |
||
132 | 3 | * Get name. |
|
133 | * |
||
134 | * @return string |
||
135 | */ |
||
136 | public function getName() |
||
140 | 3 | ||
141 | /** |
||
142 | 3 | * Gets the value of visible. |
|
143 | * |
||
144 | * @return bool |
||
145 | */ |
||
146 | public function getVisible() |
||
150 | |||
151 | /** |
||
152 | 14 | * Sets the value of visible. |
|
153 | * |
||
154 | 14 | * @param bool $visible the visible |
|
155 | * |
||
156 | 14 | * @return WidgetModel |
|
157 | */ |
||
158 | public function setVisible($visible = true) |
||
164 | 3 | ||
165 | /** |
||
166 | 3 | * Gets the value of type. |
|
167 | * |
||
168 | * @return string |
||
169 | */ |
||
170 | public function getType() |
||
174 | |||
175 | /** |
||
176 | 14 | * Sets the value of type. |
|
177 | * |
||
178 | 14 | * @param int $type the type |
|
179 | 14 | * |
|
180 | * @return WidgetModel |
||
181 | 1 | */ |
|
182 | public function setType($type = self::TYPE_HTML) |
||
196 | |||
197 | /** |
||
198 | * {@inheritdoc} |
||
199 | */ |
||
200 | public function getParameters() |
||
204 | 14 | ||
205 | /** |
||
206 | 14 | * Sets the value of parameters. |
|
207 | * |
||
208 | * @param array $parameters the parameters |
||
209 | * |
||
210 | * @return WidgetModel |
||
211 | */ |
||
212 | public function setParameters(array $parameters = []) |
||
218 | |||
219 | /** |
||
220 | * Gets the value of containers. |
||
221 | * |
||
222 | * @return ArrayCollection |
||
223 | */ |
||
224 | public function getContainers() |
||
228 | |||
229 | /** |
||
230 | * {@inheritdoc} |
||
231 | */ |
||
232 | public function getCreatedAt() |
||
236 | |||
237 | /** |
||
238 | * {@inheritdoc} |
||
239 | */ |
||
240 | public function setCreatedAt(\DateTime $createdAt) |
||
244 | |||
245 | /** |
||
246 | * {@inheritdoc} |
||
247 | */ |
||
248 | public function getUpdatedAt() |
||
256 | |||
257 | /** |
||
258 | * {@inheritdoc} |
||
259 | */ |
||
260 | public function setUpdatedAt(\DateTime $updatedAt) |
||
264 | |||
265 | /** |
||
266 | * Sets the value of containers. |
||
267 | * |
||
268 | * @param ArrayCollection $containers the containers |
||
269 | * |
||
270 | * @return WidgetModel |
||
271 | */ |
||
272 | protected function setContainers(ArrayCollection $containers) |
||
278 | } |
||
279 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.