|
1
|
|
|
<?php |
|
2
|
|
|
/******************************************************************************* |
|
3
|
|
|
* This file is part of the Pbxg33k\MusicInfo package. |
|
4
|
|
|
* |
|
5
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
6
|
|
|
* file that was distributed with this source code. |
|
7
|
|
|
* |
|
8
|
|
|
* (c) 2017 Oguzhan uysal. All rights reserved |
|
9
|
|
|
******************************************************************************/ |
|
10
|
|
|
|
|
11
|
|
|
namespace Pbxg33k\MusicInfo\Model; |
|
12
|
|
|
|
|
13
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* Class Album |
|
17
|
|
|
* |
|
18
|
|
|
* @package Model |
|
19
|
|
|
*/ |
|
20
|
|
|
class Album extends BaseModel |
|
21
|
|
|
{ |
|
22
|
|
|
const TYPE_ALBUM = 'album'; |
|
23
|
|
|
const TYPE_SINGLE = 'single'; |
|
24
|
|
|
const TYPE_COMPILATION = 'compilation'; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* @var string |
|
28
|
|
|
*/ |
|
29
|
|
|
protected $id; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @var string |
|
33
|
|
|
*/ |
|
34
|
|
|
protected $name; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* @var string |
|
38
|
|
|
*/ |
|
39
|
|
|
protected $type; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @var ArrayCollection |
|
43
|
|
|
*/ |
|
44
|
|
|
protected $artists; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @var ArrayCollection |
|
48
|
|
|
*/ |
|
49
|
|
|
protected $tracks; |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @var string |
|
53
|
|
|
*/ |
|
54
|
|
|
protected $image; |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* @var string |
|
58
|
|
|
*/ |
|
59
|
|
|
protected $uri; |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* @var ArrayCollection |
|
63
|
|
|
*/ |
|
64
|
|
|
protected $genres; |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* @var \DateTimeInterface |
|
68
|
|
|
*/ |
|
69
|
|
|
protected $release_date; |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* @var string |
|
73
|
|
|
*/ |
|
74
|
|
|
protected $label; |
|
75
|
|
|
|
|
76
|
|
|
/** |
|
77
|
|
|
* @return string |
|
78
|
|
|
*/ |
|
79
|
|
|
public function getId() |
|
80
|
|
|
{ |
|
81
|
|
|
return $this->id; |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
/** |
|
85
|
|
|
* @param string $id |
|
86
|
|
|
* |
|
87
|
|
|
* @return Album |
|
88
|
|
|
*/ |
|
89
|
|
|
public function setId($id) |
|
90
|
|
|
{ |
|
91
|
|
|
$this->id = $id; |
|
92
|
|
|
|
|
93
|
|
|
return $this; |
|
94
|
|
|
} |
|
95
|
|
|
|
|
96
|
|
|
/** |
|
97
|
|
|
* @return string |
|
98
|
|
|
*/ |
|
99
|
|
|
public function getName() |
|
100
|
|
|
{ |
|
101
|
|
|
return $this->name; |
|
102
|
|
|
} |
|
103
|
|
|
|
|
104
|
|
|
/** |
|
105
|
|
|
* @param string $name |
|
106
|
|
|
* |
|
107
|
|
|
* @return Album |
|
108
|
|
|
*/ |
|
109
|
|
|
public function setName($name) |
|
110
|
|
|
{ |
|
111
|
|
|
$this->name = $name; |
|
112
|
|
|
|
|
113
|
|
|
return $this; |
|
114
|
|
|
} |
|
115
|
|
|
|
|
116
|
|
|
/** |
|
117
|
|
|
* @return string |
|
118
|
|
|
*/ |
|
119
|
|
|
public function getType() |
|
120
|
|
|
{ |
|
121
|
|
|
return $this->type; |
|
122
|
|
|
} |
|
123
|
|
|
|
|
124
|
|
|
/** |
|
125
|
|
|
* @param string $type |
|
126
|
|
|
* |
|
127
|
|
|
* @return Album |
|
128
|
|
|
*/ |
|
129
|
|
|
public function setType($type) |
|
130
|
|
|
{ |
|
131
|
|
|
$this->type = $type; |
|
132
|
|
|
|
|
133
|
|
|
return $this; |
|
134
|
|
|
} |
|
135
|
|
|
|
|
136
|
|
|
/** |
|
137
|
|
|
* @return ArrayCollection |
|
138
|
|
|
*/ |
|
139
|
|
|
public function getArtists() |
|
140
|
|
|
{ |
|
141
|
|
|
return $this->artists; |
|
142
|
|
|
} |
|
143
|
|
|
|
|
144
|
|
|
/** |
|
145
|
|
|
* @param ArrayCollection $artists |
|
146
|
|
|
* |
|
147
|
|
|
* @return Album |
|
148
|
|
|
*/ |
|
149
|
|
|
public function setArtists($artists) |
|
150
|
|
|
{ |
|
151
|
|
|
$this->artists = $artists; |
|
152
|
|
|
|
|
153
|
|
|
return $this; |
|
154
|
|
|
} |
|
155
|
|
|
|
|
156
|
|
|
/** |
|
157
|
|
|
* @param Artist $artist |
|
158
|
|
|
* |
|
159
|
|
|
* @return $this |
|
160
|
|
|
*/ |
|
161
|
|
|
public function addArtist(Artist $artist) |
|
162
|
|
|
{ |
|
163
|
|
|
$this->artists->add($artist); |
|
164
|
|
|
|
|
165
|
|
|
return $this; |
|
166
|
|
|
} |
|
167
|
|
|
|
|
168
|
|
|
/** |
|
169
|
|
|
* @param Artist $artist |
|
170
|
|
|
* |
|
171
|
|
|
* @return $this |
|
172
|
|
|
*/ |
|
173
|
|
|
public function removeArtist(Artist $artist) |
|
174
|
|
|
{ |
|
175
|
|
|
$this->artists->removeElement($artist); |
|
176
|
|
|
|
|
177
|
|
|
return $this; |
|
178
|
|
|
} |
|
179
|
|
|
|
|
180
|
|
|
/** |
|
181
|
|
|
* @return ArrayCollection |
|
182
|
|
|
*/ |
|
183
|
|
|
public function getTracks() |
|
184
|
|
|
{ |
|
185
|
|
|
return $this->tracks; |
|
186
|
|
|
} |
|
187
|
|
|
|
|
188
|
|
|
/** |
|
189
|
|
|
* @param ArrayCollection $tracks |
|
190
|
|
|
* |
|
191
|
|
|
* @return Album |
|
192
|
|
|
*/ |
|
193
|
|
|
public function setTracks($tracks) |
|
194
|
|
|
{ |
|
195
|
|
|
$this->tracks = $tracks; |
|
196
|
|
|
|
|
197
|
|
|
return $this; |
|
198
|
|
|
} |
|
199
|
|
|
|
|
200
|
|
|
/** |
|
201
|
|
|
* @param Track $track |
|
202
|
|
|
* |
|
203
|
|
|
* @return $this |
|
204
|
|
|
*/ |
|
205
|
|
|
public function addTrack(Track $track) |
|
206
|
|
|
{ |
|
207
|
|
|
$this->tracks->add($track); |
|
208
|
|
|
|
|
209
|
|
|
return $this; |
|
210
|
|
|
} |
|
211
|
|
|
|
|
212
|
|
|
/** |
|
213
|
|
|
* @param Track $track |
|
214
|
|
|
* |
|
215
|
|
|
* @return $this |
|
216
|
|
|
*/ |
|
217
|
|
|
public function removeTrack(Track $track) |
|
218
|
|
|
{ |
|
219
|
|
|
$this->tracks->removeElement($track); |
|
220
|
|
|
|
|
221
|
|
|
return $this; |
|
222
|
|
|
} |
|
223
|
|
|
|
|
224
|
|
|
/** |
|
225
|
|
|
* @return string |
|
226
|
|
|
*/ |
|
227
|
|
|
public function getImage() |
|
228
|
|
|
{ |
|
229
|
|
|
return $this->image; |
|
230
|
|
|
} |
|
231
|
|
|
|
|
232
|
|
|
/** |
|
233
|
|
|
* @param string $image |
|
234
|
|
|
* |
|
235
|
|
|
* @return Album |
|
236
|
|
|
*/ |
|
237
|
|
|
public function setImage($image) |
|
238
|
|
|
{ |
|
239
|
|
|
$this->image = $image; |
|
240
|
|
|
|
|
241
|
|
|
return $this; |
|
242
|
|
|
} |
|
243
|
|
|
|
|
244
|
|
|
/** |
|
245
|
|
|
* @return string |
|
246
|
|
|
*/ |
|
247
|
|
|
public function getUri() |
|
248
|
|
|
{ |
|
249
|
|
|
return $this->uri; |
|
250
|
|
|
} |
|
251
|
|
|
|
|
252
|
|
|
/** |
|
253
|
|
|
* @param string $uri |
|
254
|
|
|
* |
|
255
|
|
|
* @return Album |
|
256
|
|
|
*/ |
|
257
|
|
|
public function setUri($uri) |
|
258
|
|
|
{ |
|
259
|
|
|
$this->uri = $uri; |
|
260
|
|
|
|
|
261
|
|
|
return $this; |
|
262
|
|
|
} |
|
263
|
|
|
|
|
264
|
|
|
/** |
|
265
|
|
|
* @return ArrayCollection |
|
266
|
|
|
*/ |
|
267
|
|
|
public function getGenres() |
|
268
|
|
|
{ |
|
269
|
|
|
return $this->genres; |
|
270
|
|
|
} |
|
271
|
|
|
|
|
272
|
|
|
/** |
|
273
|
|
|
* @param ArrayCollection $genres |
|
274
|
|
|
* |
|
275
|
|
|
* @return Album |
|
276
|
|
|
*/ |
|
277
|
|
|
public function setGenres($genres) |
|
278
|
|
|
{ |
|
279
|
|
|
$this->genres = $genres; |
|
280
|
|
|
|
|
281
|
|
|
return $this; |
|
282
|
|
|
} |
|
283
|
|
|
|
|
284
|
|
|
/** |
|
285
|
|
|
* @return \DateTimeInterface |
|
286
|
|
|
*/ |
|
287
|
|
|
public function getReleaseDate() |
|
288
|
|
|
{ |
|
289
|
|
|
return $this->release_date; |
|
290
|
|
|
} |
|
291
|
|
|
|
|
292
|
|
|
/** |
|
293
|
|
|
* @param \DateTimeInterface $release_date |
|
294
|
|
|
* |
|
295
|
|
|
* @return Album |
|
296
|
|
|
*/ |
|
297
|
|
|
public function setReleaseDate($release_date) |
|
298
|
|
|
{ |
|
299
|
|
|
$this->release_date = $release_date; |
|
300
|
|
|
|
|
301
|
|
|
return $this; |
|
302
|
|
|
} |
|
303
|
|
|
|
|
304
|
|
|
/** |
|
305
|
|
|
* @return string |
|
306
|
|
|
*/ |
|
307
|
|
|
public function getLabel() |
|
308
|
|
|
{ |
|
309
|
|
|
return $this->label; |
|
310
|
|
|
} |
|
311
|
|
|
|
|
312
|
|
|
/** |
|
313
|
|
|
* @param string $label |
|
314
|
|
|
* |
|
315
|
|
|
* @return Album |
|
316
|
|
|
*/ |
|
317
|
|
|
public function setLabel($label) |
|
318
|
|
|
{ |
|
319
|
|
|
$this->label = $label; |
|
320
|
|
|
|
|
321
|
|
|
return $this; |
|
322
|
|
|
} |
|
323
|
|
|
} |
|
324
|
|
|
|