1 | <?php |
||
28 | class PerformanceEvent extends AbstractPersonalTranslatable implements TranslatableInterface |
||
29 | { |
||
30 | use TimestampableTrait, BlameableEntity, DeletedByTrait; |
||
31 | |||
32 | const VENUE_PHILHARMONIC = "venue-philharmonic"; |
||
33 | const VENUE_KULIC_HOUSE = "venue-kilic-house"; |
||
34 | const VENUE_THEATRE = "venue-theatre"; |
||
35 | |||
36 | public static $venues = [ |
||
37 | self::VENUE_PHILHARMONIC => self::VENUE_PHILHARMONIC, |
||
38 | self::VENUE_KULIC_HOUSE => self::VENUE_KULIC_HOUSE, |
||
39 | self::VENUE_THEATRE => self::VENUE_THEATRE, |
||
40 | ]; |
||
41 | |||
42 | /** |
||
43 | * @var integer |
||
44 | * |
||
45 | * @ORM\Column(name="id", type="integer") |
||
46 | * @ORM\Id |
||
47 | * @ORM\GeneratedValue(strategy="AUTO") |
||
48 | * @Type("integer") |
||
49 | * @Expose |
||
50 | */ |
||
51 | private $id; |
||
52 | |||
53 | /** |
||
54 | * @var Performance |
||
55 | * |
||
56 | * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Performance", inversedBy="performanceEvents") |
||
57 | * @Type("AppBundle\Entity\Performance") |
||
58 | * @Expose |
||
59 | */ |
||
60 | private $performance; |
||
61 | |||
62 | /** |
||
63 | * @var /Datetime |
||
64 | * |
||
65 | * @Assert\NotBlank() |
||
66 | * @ORM\Column(type="datetime") |
||
67 | * @Type("DateTime") |
||
68 | * @Expose |
||
69 | */ |
||
70 | private $dateTime; |
||
71 | |||
72 | /** |
||
73 | * Place where performance happens |
||
74 | * @var string |
||
75 | * @ORM\Column(type="string") |
||
76 | * @Type("string") |
||
77 | * @Expose |
||
78 | */ |
||
79 | private $venue; |
||
80 | |||
81 | /** |
||
82 | * @var int |
||
83 | * |
||
84 | * @Type("integer") |
||
85 | * @Expose |
||
86 | * @Accessor(getter="getYear") |
||
87 | */ |
||
88 | private $year; |
||
89 | |||
90 | /** |
||
91 | * @var int |
||
92 | * |
||
93 | * @Expose |
||
94 | * @Accessor(getter="getMonth") |
||
95 | */ |
||
96 | private $month; |
||
97 | |||
98 | /** |
||
99 | * @var int |
||
100 | * |
||
101 | * @Expose |
||
102 | * @Accessor(getter="getDay") |
||
103 | */ |
||
104 | private $day; |
||
105 | |||
106 | /** |
||
107 | * @var string |
||
108 | * |
||
109 | * @Expose |
||
110 | * @Accessor(getter="getTime") |
||
111 | */ |
||
112 | private $time; |
||
113 | |||
114 | /** |
||
115 | * @var ArrayCollection|Translation[] |
||
116 | * |
||
117 | * @ORM\OneToMany( |
||
118 | * targetEntity="AppBundle\Entity\Translations\PerformanceEventTranslation", |
||
119 | * mappedBy="object", |
||
120 | * cascade={"persist", "remove"} |
||
121 | * ) |
||
122 | */ |
||
123 | protected $translations; |
||
124 | |||
125 | /** |
||
126 | * Unset translations |
||
127 | * |
||
128 | * @return PerformanceEvent |
||
129 | */ |
||
130 | 4 | public function unsetTranslations() |
|
136 | |||
137 | /** |
||
138 | * Get id |
||
139 | * |
||
140 | * @return integer |
||
141 | */ |
||
142 | 9 | public function getId() |
|
146 | |||
147 | /** |
||
148 | * Set dateTime |
||
149 | * |
||
150 | * @param \DateTime $dateTime |
||
151 | * @return PerformanceEvent |
||
152 | */ |
||
153 | 7 | public function setDateTime($dateTime) |
|
159 | |||
160 | /** |
||
161 | * Get dateTime |
||
162 | * |
||
163 | * @return \DateTime |
||
164 | */ |
||
165 | 12 | public function getDateTime() |
|
169 | |||
170 | /** |
||
171 | * Set performance |
||
172 | * |
||
173 | * @param \AppBundle\Entity\Performance $performance |
||
174 | * @return PerformanceEvent |
||
175 | */ |
||
176 | public function setPerformance(\AppBundle\Entity\Performance $performance = null) |
||
182 | |||
183 | /** |
||
184 | * Get performance |
||
185 | * |
||
186 | * @return \AppBundle\Entity\Performance |
||
187 | */ |
||
188 | 3 | public function getPerformance() |
|
192 | |||
193 | 1 | public function __toString() |
|
194 | { |
||
195 | 1 | if ($this->getDateTime()) { |
|
196 | 1 | return $this->getDateTime()->format('d-m-Y H:i'); |
|
197 | } |
||
198 | |||
199 | return date("F j, Y, g:i a"); |
||
200 | } |
||
201 | |||
202 | /** |
||
203 | * @return mixed |
||
204 | */ |
||
205 | 4 | public function getYear() |
|
209 | |||
210 | /** |
||
211 | * @param mixed $year |
||
212 | */ |
||
213 | public function setYear($year) |
||
217 | |||
218 | /** |
||
219 | * @return int |
||
220 | */ |
||
221 | 4 | public function getMonth() |
|
225 | |||
226 | /** |
||
227 | * @param int $month |
||
228 | */ |
||
229 | public function setMonth($month) |
||
233 | |||
234 | /** |
||
235 | * @return int |
||
236 | */ |
||
237 | 4 | public function getDay() |
|
241 | |||
242 | /** |
||
243 | * @param int $day |
||
244 | */ |
||
245 | public function setDay($day) |
||
249 | |||
250 | /** |
||
251 | * @return string |
||
252 | */ |
||
253 | 4 | public function getTime() |
|
257 | |||
258 | /** |
||
259 | * @param string $time |
||
260 | */ |
||
261 | public function setTime($time) |
||
265 | |||
266 | /** |
||
267 | * @return string |
||
268 | */ |
||
269 | 4 | public function getVenue() |
|
273 | |||
274 | /** |
||
275 | * @param string $venue |
||
276 | */ |
||
277 | 4 | public function setVenue($venue) |
|
281 | } |
||
282 |