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