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
|
2 |
|
public function getId() |
80
|
|
|
{ |
81
|
2 |
|
return $this->id; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @param string $id |
86
|
|
|
* |
87
|
|
|
* @return Album |
88
|
|
|
*/ |
89
|
4 |
|
public function setId($id) |
90
|
|
|
{ |
91
|
4 |
|
$this->id = $id; |
92
|
|
|
|
93
|
4 |
|
return $this; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @return string |
98
|
|
|
*/ |
99
|
2 |
|
public function getName() |
100
|
|
|
{ |
101
|
2 |
|
return $this->name; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @param string $name |
106
|
|
|
* |
107
|
|
|
* @return Album |
108
|
|
|
*/ |
109
|
4 |
|
public function setName($name) |
110
|
|
|
{ |
111
|
4 |
|
$this->name = $name; |
112
|
|
|
|
113
|
4 |
|
return $this; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @return string |
118
|
|
|
*/ |
119
|
2 |
|
public function getType() |
120
|
|
|
{ |
121
|
2 |
|
return $this->type; |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* @param string $type |
126
|
|
|
* |
127
|
|
|
* @return Album |
128
|
|
|
*/ |
129
|
4 |
|
public function setType($type) |
130
|
|
|
{ |
131
|
4 |
|
$this->type = $type; |
132
|
|
|
|
133
|
4 |
|
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
|
2 |
|
public function setArtists($artists) |
150
|
|
|
{ |
151
|
2 |
|
$this->artists = $artists; |
152
|
|
|
|
153
|
2 |
|
return $this; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* @return ArrayCollection |
158
|
|
|
*/ |
159
|
|
|
public function getTracks() |
160
|
|
|
{ |
161
|
|
|
return $this->tracks; |
162
|
|
|
} |
163
|
|
|
|
164
|
|
|
/** |
165
|
|
|
* @param ArrayCollection $tracks |
166
|
|
|
* |
167
|
|
|
* @return Album |
168
|
|
|
*/ |
169
|
|
|
public function setTracks($tracks) |
170
|
|
|
{ |
171
|
|
|
$this->tracks = $tracks; |
172
|
|
|
|
173
|
|
|
return $this; |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* @return string |
178
|
|
|
*/ |
179
|
2 |
|
public function getImage() |
180
|
|
|
{ |
181
|
2 |
|
return $this->image; |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* @param string $image |
186
|
|
|
* |
187
|
|
|
* @return Album |
188
|
|
|
*/ |
189
|
2 |
|
public function setImage($image) |
190
|
|
|
{ |
191
|
2 |
|
$this->image = $image; |
192
|
|
|
|
193
|
2 |
|
return $this; |
194
|
|
|
} |
195
|
|
|
|
196
|
|
|
/** |
197
|
|
|
* @return string |
198
|
|
|
*/ |
199
|
|
|
public function getUri() |
200
|
|
|
{ |
201
|
|
|
return $this->uri; |
202
|
|
|
} |
203
|
|
|
|
204
|
|
|
/** |
205
|
|
|
* @param string $uri |
206
|
|
|
* |
207
|
|
|
* @return Album |
208
|
|
|
*/ |
209
|
3 |
|
public function setUri($uri) |
210
|
|
|
{ |
211
|
3 |
|
$this->uri = $uri; |
212
|
|
|
|
213
|
3 |
|
return $this; |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
/** |
217
|
|
|
* @return ArrayCollection |
218
|
|
|
*/ |
219
|
|
|
public function getGenres() |
220
|
|
|
{ |
221
|
|
|
return $this->genres; |
222
|
|
|
} |
223
|
|
|
|
224
|
|
|
/** |
225
|
|
|
* @param ArrayCollection $genres |
226
|
|
|
* |
227
|
|
|
* @return Album |
228
|
|
|
*/ |
229
|
|
|
public function setGenres($genres) |
230
|
|
|
{ |
231
|
|
|
$this->genres = $genres; |
232
|
|
|
|
233
|
|
|
return $this; |
234
|
|
|
} |
235
|
|
|
|
236
|
|
|
/** |
237
|
|
|
* @return \DateTimeInterface |
238
|
|
|
*/ |
239
|
|
|
public function getReleaseDate() |
240
|
|
|
{ |
241
|
|
|
return $this->release_date; |
242
|
|
|
} |
243
|
|
|
|
244
|
|
|
/** |
245
|
|
|
* @param \DateTimeInterface $release_date |
246
|
|
|
* |
247
|
|
|
* @return Album |
248
|
|
|
*/ |
249
|
2 |
|
public function setReleaseDate($release_date) |
250
|
|
|
{ |
251
|
2 |
|
$this->release_date = $release_date; |
252
|
|
|
|
253
|
2 |
|
return $this; |
254
|
|
|
} |
255
|
|
|
|
256
|
|
|
/** |
257
|
|
|
* @return string |
258
|
|
|
*/ |
259
|
|
|
public function getLabel() |
260
|
|
|
{ |
261
|
|
|
return $this->label; |
262
|
|
|
} |
263
|
|
|
|
264
|
|
|
/** |
265
|
|
|
* @param string $label |
266
|
|
|
* |
267
|
|
|
* @return Album |
268
|
|
|
*/ |
269
|
|
|
public function setLabel($label) |
270
|
|
|
{ |
271
|
|
|
$this->label = $label; |
272
|
|
|
|
273
|
|
|
return $this; |
274
|
|
|
} |
275
|
|
|
} |
276
|
|
|
|