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
|
3 |
|
public function getId() |
80
|
|
|
{ |
81
|
3 |
|
return $this->id; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @param string $id |
86
|
|
|
* |
87
|
|
|
* @return Album |
88
|
|
|
*/ |
89
|
5 |
|
public function setId($id) |
90
|
|
|
{ |
91
|
5 |
|
$this->id = $id; |
92
|
|
|
|
93
|
5 |
|
return $this; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @return string |
98
|
|
|
*/ |
99
|
3 |
|
public function getName() |
100
|
|
|
{ |
101
|
3 |
|
return $this->name; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @param string $name |
106
|
|
|
* |
107
|
|
|
* @return Album |
108
|
|
|
*/ |
109
|
5 |
|
public function setName($name) |
110
|
|
|
{ |
111
|
5 |
|
$this->name = $name; |
112
|
|
|
|
113
|
5 |
|
return $this; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @return string |
118
|
|
|
*/ |
119
|
3 |
|
public function getType() |
120
|
|
|
{ |
121
|
3 |
|
return $this->type; |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* @param string $type |
126
|
|
|
* |
127
|
|
|
* @return Album |
128
|
|
|
*/ |
129
|
5 |
|
public function setType($type) |
130
|
|
|
{ |
131
|
5 |
|
$this->type = $type; |
132
|
|
|
|
133
|
5 |
|
return $this; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* @return ArrayCollection |
138
|
|
|
*/ |
139
|
1 |
|
public function getArtists() |
140
|
|
|
{ |
141
|
1 |
|
return $this->artists; |
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* @param ArrayCollection $artists |
146
|
|
|
* |
147
|
|
|
* @return Album |
148
|
|
|
*/ |
149
|
3 |
|
public function setArtists($artists) |
150
|
|
|
{ |
151
|
3 |
|
$this->artists = $artists; |
152
|
|
|
|
153
|
3 |
|
return $this; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* @param Artist $artist |
158
|
|
|
* |
159
|
|
|
* @return $this |
160
|
|
|
*/ |
161
|
1 |
|
public function addArtist(Artist $artist) |
162
|
|
|
{ |
163
|
1 |
|
$this->artists->add($artist); |
164
|
|
|
|
165
|
1 |
|
return $this; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* @param Artist $artist |
170
|
|
|
* |
171
|
|
|
* @return $this |
172
|
|
|
*/ |
173
|
1 |
|
public function removeArtist(Artist $artist) |
174
|
|
|
{ |
175
|
1 |
|
$this->artists->removeElement($artist); |
176
|
|
|
|
177
|
1 |
|
return $this; |
178
|
|
|
} |
179
|
|
|
|
180
|
|
|
/** |
181
|
|
|
* @return ArrayCollection |
182
|
|
|
*/ |
183
|
1 |
|
public function getTracks() |
184
|
|
|
{ |
185
|
1 |
|
return $this->tracks; |
186
|
|
|
} |
187
|
|
|
|
188
|
|
|
/** |
189
|
|
|
* @param ArrayCollection $tracks |
190
|
|
|
* |
191
|
|
|
* @return Album |
192
|
|
|
*/ |
193
|
1 |
|
public function setTracks($tracks) |
194
|
|
|
{ |
195
|
1 |
|
$this->tracks = $tracks; |
196
|
|
|
|
197
|
1 |
|
return $this; |
198
|
|
|
} |
199
|
|
|
|
200
|
|
|
/** |
201
|
|
|
* @param Track $track |
202
|
|
|
* |
203
|
|
|
* @return $this |
204
|
|
|
*/ |
205
|
1 |
|
public function addTrack(Track $track) |
206
|
|
|
{ |
207
|
1 |
|
$this->tracks->add($track); |
208
|
|
|
|
209
|
1 |
|
return $this; |
210
|
|
|
} |
211
|
|
|
|
212
|
|
|
/** |
213
|
|
|
* @param Track $track |
214
|
|
|
* |
215
|
|
|
* @return $this |
216
|
|
|
*/ |
217
|
1 |
|
public function removeTrack(Track $track) |
218
|
|
|
{ |
219
|
1 |
|
$this->tracks->removeElement($track); |
220
|
|
|
|
221
|
1 |
|
return $this; |
222
|
|
|
} |
223
|
|
|
|
224
|
|
|
/** |
225
|
|
|
* @return string |
226
|
|
|
*/ |
227
|
3 |
|
public function getImage() |
228
|
|
|
{ |
229
|
3 |
|
return $this->image; |
230
|
|
|
} |
231
|
|
|
|
232
|
|
|
/** |
233
|
|
|
* @param string $image |
234
|
|
|
* |
235
|
|
|
* @return Album |
236
|
|
|
*/ |
237
|
3 |
|
public function setImage($image) |
238
|
|
|
{ |
239
|
3 |
|
$this->image = $image; |
240
|
|
|
|
241
|
3 |
|
return $this; |
242
|
|
|
} |
243
|
|
|
|
244
|
|
|
/** |
245
|
|
|
* @return string |
246
|
|
|
*/ |
247
|
1 |
|
public function getUri() |
248
|
|
|
{ |
249
|
1 |
|
return $this->uri; |
250
|
|
|
} |
251
|
|
|
|
252
|
|
|
/** |
253
|
|
|
* @param string $uri |
254
|
|
|
* |
255
|
|
|
* @return Album |
256
|
|
|
*/ |
257
|
4 |
|
public function setUri($uri) |
258
|
|
|
{ |
259
|
4 |
|
$this->uri = $uri; |
260
|
|
|
|
261
|
4 |
|
return $this; |
262
|
|
|
} |
263
|
|
|
|
264
|
|
|
/** |
265
|
|
|
* @return ArrayCollection |
266
|
|
|
*/ |
267
|
1 |
|
public function getGenres() |
268
|
|
|
{ |
269
|
1 |
|
return $this->genres; |
270
|
|
|
} |
271
|
|
|
|
272
|
|
|
/** |
273
|
|
|
* @param ArrayCollection $genres |
274
|
|
|
* |
275
|
|
|
* @return Album |
276
|
|
|
*/ |
277
|
1 |
|
public function setGenres($genres) |
278
|
|
|
{ |
279
|
1 |
|
$this->genres = $genres; |
280
|
|
|
|
281
|
1 |
|
return $this; |
282
|
|
|
} |
283
|
|
|
|
284
|
|
|
/** |
285
|
|
|
* @return \DateTimeInterface |
286
|
|
|
*/ |
287
|
1 |
|
public function getReleaseDate() |
288
|
|
|
{ |
289
|
1 |
|
return $this->release_date; |
290
|
|
|
} |
291
|
|
|
|
292
|
|
|
/** |
293
|
|
|
* @param \DateTimeInterface $release_date |
294
|
|
|
* |
295
|
|
|
* @return Album |
296
|
|
|
*/ |
297
|
3 |
|
public function setReleaseDate($release_date) |
298
|
|
|
{ |
299
|
3 |
|
$this->release_date = $release_date; |
300
|
|
|
|
301
|
3 |
|
return $this; |
302
|
|
|
} |
303
|
|
|
|
304
|
|
|
/** |
305
|
|
|
* @return string |
306
|
|
|
*/ |
307
|
1 |
|
public function getLabel() |
308
|
|
|
{ |
309
|
1 |
|
return $this->label; |
310
|
|
|
} |
311
|
|
|
|
312
|
|
|
/** |
313
|
|
|
* @param string $label |
314
|
|
|
* |
315
|
|
|
* @return Album |
316
|
|
|
*/ |
317
|
1 |
|
public function setLabel($label) |
318
|
|
|
{ |
319
|
1 |
|
$this->label = $label; |
320
|
|
|
|
321
|
1 |
|
return $this; |
322
|
|
|
} |
323
|
|
|
} |
324
|
|
|
|