1 | <?php |
||
16 | class Link |
||
17 | { |
||
18 | const TYPE_NONE = 'none'; |
||
19 | const TYPE_VIEW_REFERENCE = 'viewReference'; |
||
20 | const TYPE_ROUTE = 'route'; |
||
21 | const TYPE_URL = 'url'; |
||
22 | const TYPE_WIDGET = 'attachedWidget'; |
||
23 | |||
24 | use \Gedmo\Timestampable\Traits\TimestampableEntity; |
||
25 | |||
26 | /** |
||
27 | * @var int |
||
28 | * |
||
29 | * @ORM\Column(name="id", type="integer") |
||
30 | * @ORM\Id |
||
31 | * @ORM\GeneratedValue(strategy="AUTO") |
||
32 | */ |
||
33 | protected $id; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | * |
||
38 | * @ORM\Column(name="url", type="string", length=255, nullable=true) |
||
39 | */ |
||
40 | protected $url; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | * |
||
45 | * @ORM\Column(name="locale", type="string", length=255, nullable=true) |
||
46 | */ |
||
47 | protected $locale = null; |
||
48 | |||
49 | /** |
||
50 | * @var string |
||
51 | * |
||
52 | * @ORM\Column(name="target", type="string", length=10, nullable=true) |
||
53 | */ |
||
54 | protected $target = '_parent'; |
||
55 | |||
56 | /** |
||
57 | * @ORM\Column(name="view_reference", type="string", length=255, nullable=true) |
||
58 | */ |
||
59 | protected $viewReference; |
||
60 | |||
61 | /** |
||
62 | * @ORM\ManyToOne(targetEntity="Victoire\Bundle\WidgetBundle\Entity\Widget") |
||
63 | * @ORM\JoinColumn(name="attached_widget_id", referencedColumnName="id", onDelete="cascade", nullable=true) |
||
64 | */ |
||
65 | protected $attachedWidget; |
||
66 | |||
67 | /** |
||
68 | * @var string |
||
69 | * |
||
70 | * @ORM\Column(name="route", type="string", length=55, nullable=true) |
||
71 | */ |
||
72 | protected $route; |
||
73 | |||
74 | /** |
||
75 | * @var string |
||
76 | * |
||
77 | * @ORM\Column(name="route_parameters", type="array", nullable=true) |
||
78 | */ |
||
79 | protected $routeParameters = []; |
||
80 | |||
81 | /** |
||
82 | * @var string |
||
83 | * |
||
84 | * @ORM\Column(name="link_type", type="string", length=255, nullable=true) |
||
85 | */ |
||
86 | protected $linkType = self::TYPE_NONE; |
||
87 | |||
88 | /** |
||
89 | * @var string |
||
90 | * |
||
91 | * @ORM\Column(name="analytics_track_code", type="text", nullable=true) |
||
92 | */ |
||
93 | protected $analyticsTrackCode; |
||
94 | |||
95 | protected $parameters; |
||
96 | protected $viewReferencePage; |
||
97 | |||
98 | /** |
||
99 | * Get id. |
||
100 | * |
||
101 | * @return int |
||
102 | */ |
||
103 | public function getId() |
||
107 | |||
108 | /** |
||
109 | * Set id. |
||
110 | * |
||
111 | * @param string $id |
||
112 | * |
||
113 | * @return Link |
||
114 | */ |
||
115 | public function setId($id) |
||
121 | |||
122 | public function getParameters() |
||
137 | |||
138 | /** |
||
139 | * Set url. |
||
140 | * |
||
141 | * @param string $url |
||
142 | * |
||
143 | * @return Link |
||
144 | */ |
||
145 | public function setUrl($url) |
||
151 | |||
152 | /** |
||
153 | * Get url. |
||
154 | * |
||
155 | * @return string |
||
156 | */ |
||
157 | public function getUrl() |
||
161 | |||
162 | /** |
||
163 | * Set target. |
||
164 | * |
||
165 | * @param string $target |
||
166 | * |
||
167 | * @return Link |
||
168 | */ |
||
169 | public function setTarget($target) |
||
175 | |||
176 | /** |
||
177 | * Get target. |
||
178 | * |
||
179 | * @return string |
||
180 | */ |
||
181 | public function getTarget() |
||
185 | |||
186 | /** |
||
187 | * Set route. |
||
188 | * |
||
189 | * @param string $route |
||
190 | * |
||
191 | * @return Link |
||
192 | */ |
||
193 | public function setRoute($route) |
||
199 | |||
200 | /** |
||
201 | * Get route. |
||
202 | * |
||
203 | * @return string |
||
204 | */ |
||
205 | public function getRoute() |
||
209 | |||
210 | /** |
||
211 | * Set routeParameters. |
||
212 | * |
||
213 | * @param array $routeParameters |
||
214 | * |
||
215 | * @return Link |
||
216 | */ |
||
217 | public function setRouteParameters($routeParameters) |
||
223 | |||
224 | /** |
||
225 | * Get routeParameters. |
||
226 | * |
||
227 | * @return string |
||
228 | */ |
||
229 | public function getRouteParameters() |
||
233 | |||
234 | /** |
||
235 | * Get viewReference. |
||
236 | * |
||
237 | * @return string |
||
238 | */ |
||
239 | public function getViewReference() |
||
243 | |||
244 | /** |
||
245 | * Set viewReference. |
||
246 | * |
||
247 | * @param string $viewReference |
||
248 | * |
||
249 | * @return Link |
||
250 | */ |
||
251 | public function setViewReference($viewReference) |
||
257 | |||
258 | /** |
||
259 | * Set linkType. |
||
260 | * |
||
261 | * @param string $linkType |
||
262 | * |
||
263 | * @return Link |
||
264 | */ |
||
265 | public function setLinkType($linkType) |
||
271 | |||
272 | /** |
||
273 | * Get linkType. |
||
274 | * |
||
275 | * @return string |
||
276 | */ |
||
277 | public function getLinkType() |
||
281 | |||
282 | /** |
||
283 | * Get attachedWidget. |
||
284 | * |
||
285 | * @return string |
||
286 | */ |
||
287 | public function getAttachedWidget() |
||
291 | |||
292 | /** |
||
293 | * Set attachedWidget. |
||
294 | * |
||
295 | * @param string $attachedWidget |
||
296 | * |
||
297 | * @return Link |
||
298 | */ |
||
299 | public function setAttachedWidget($attachedWidget) |
||
305 | |||
306 | public static function loadValidatorMetadata(ClassMetadata $metadata) |
||
310 | |||
311 | /** |
||
312 | * undocumented function. |
||
313 | * |
||
314 | * @param ExecutionContextInterface $context |
||
315 | * |
||
316 | * @author |
||
317 | */ |
||
318 | public function checkLink(ExecutionContextInterface $context) |
||
343 | |||
344 | /** |
||
345 | * Get analyticsTrackCode. |
||
346 | * |
||
347 | * @return string |
||
348 | */ |
||
349 | public function getAnalyticsTrackCode() |
||
353 | |||
354 | /** |
||
355 | * Set analyticsTrackCode. |
||
356 | * |
||
357 | * @param string $analyticsTrackCode |
||
358 | * |
||
359 | * @return Link |
||
360 | */ |
||
361 | public function setAnalyticsTrackCode($analyticsTrackCode) |
||
367 | |||
368 | /** |
||
369 | * Get viewReferencePage. |
||
370 | * |
||
371 | * @return mixed |
||
372 | */ |
||
373 | public function getViewReferencePage() |
||
377 | |||
378 | /** |
||
379 | * Set viewReferencePage. |
||
380 | * |
||
381 | * @param mixed $viewReferencePage |
||
382 | * |
||
383 | * @return Link |
||
384 | */ |
||
385 | public function setViewReferencePage($viewReferencePage) |
||
391 | |||
392 | /** |
||
393 | * @return string |
||
394 | */ |
||
395 | public function getLocale() |
||
399 | |||
400 | /** |
||
401 | * @param string $locale |
||
402 | * |
||
403 | * @return Link |
||
404 | */ |
||
405 | public function setLocale($locale) |
||
411 | } |
||
412 |
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.