|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
* This file is part of the La Voz Feed Generator package. |
|
4
|
|
|
* |
|
5
|
|
|
* (c) Zephia <[email protected]> |
|
6
|
|
|
* |
|
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
8
|
|
|
* file that was distributed with this source code. |
|
9
|
|
|
*/ |
|
10
|
|
|
|
|
11
|
|
|
namespace Zephia\LaVozFeed\Entity; |
|
12
|
|
|
use Zephia\LaVozFeed\Exception\LogicException; |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* Class Vehicle |
|
16
|
|
|
* |
|
17
|
|
|
* @package Zephia\LaVozFeed\Entity |
|
18
|
|
|
* @author Mauro Moreno <[email protected]> |
|
19
|
|
|
*/ |
|
20
|
|
|
class Vehicle extends Ad |
|
21
|
|
|
{ |
|
22
|
|
|
/** |
|
23
|
|
|
* @var string |
|
24
|
|
|
*/ |
|
25
|
|
|
protected $color; |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* @var string |
|
29
|
|
|
*/ |
|
30
|
|
|
protected $confort; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* @var int |
|
34
|
|
|
*/ |
|
35
|
|
|
protected $doors; |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* @var string |
|
39
|
|
|
*/ |
|
40
|
|
|
protected $fuel; |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @var int |
|
44
|
|
|
*/ |
|
45
|
|
|
protected $kilometers; |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* @var string |
|
49
|
|
|
*/ |
|
50
|
|
|
protected $model = ''; |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @var string |
|
54
|
|
|
*/ |
|
55
|
|
|
protected $receives_lesser_value; |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* @var string |
|
59
|
|
|
*/ |
|
60
|
|
|
protected $security; |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* @var string |
|
64
|
|
|
*/ |
|
65
|
|
|
protected $segment; |
|
66
|
|
|
|
|
67
|
|
|
/** |
|
68
|
|
|
* @var string |
|
69
|
|
|
*/ |
|
70
|
|
|
protected $transmission; |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* @var string |
|
74
|
|
|
*/ |
|
75
|
|
|
protected $version; |
|
76
|
|
|
|
|
77
|
|
|
/** |
|
78
|
|
|
* @var integer |
|
79
|
|
|
*/ |
|
80
|
|
|
protected $year = 0; |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* Get Color |
|
84
|
|
|
* |
|
85
|
|
|
* @return string |
|
86
|
|
|
*/ |
|
87
|
2 |
|
public function getColor() |
|
88
|
|
|
{ |
|
89
|
2 |
|
return $this->color; |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
/** |
|
93
|
|
|
* Set Color |
|
94
|
|
|
* |
|
95
|
|
|
* @param string $color |
|
96
|
|
|
* |
|
97
|
|
|
* @return Vehicle |
|
98
|
|
|
*/ |
|
99
|
2 |
|
public function setColor($color) |
|
100
|
|
|
{ |
|
101
|
2 |
|
$this->color = $color; |
|
102
|
2 |
|
return $this; |
|
103
|
|
|
} |
|
104
|
|
|
|
|
105
|
|
|
/** |
|
106
|
|
|
* Get Confort |
|
107
|
|
|
* |
|
108
|
|
|
* @return string |
|
109
|
|
|
*/ |
|
110
|
2 |
|
public function getConfort() |
|
111
|
|
|
{ |
|
112
|
2 |
|
return $this->confort; |
|
113
|
|
|
} |
|
114
|
|
|
|
|
115
|
|
|
/** |
|
116
|
|
|
* Set Confort |
|
117
|
|
|
* |
|
118
|
|
|
* @param string $confort |
|
119
|
|
|
* |
|
120
|
|
|
* @return Vehicle |
|
121
|
|
|
*/ |
|
122
|
2 |
|
public function setConfort($confort) |
|
123
|
|
|
{ |
|
124
|
2 |
|
$this->confort = $confort; |
|
125
|
2 |
|
return $this; |
|
126
|
|
|
} |
|
127
|
|
|
|
|
128
|
|
|
/** |
|
129
|
|
|
* Get Doors |
|
130
|
|
|
* |
|
131
|
|
|
* @return int |
|
132
|
|
|
*/ |
|
133
|
2 |
|
public function getDoors() |
|
134
|
|
|
{ |
|
135
|
2 |
|
return $this->doors; |
|
136
|
|
|
} |
|
137
|
|
|
|
|
138
|
|
|
/** |
|
139
|
|
|
* Set Doors |
|
140
|
|
|
* |
|
141
|
|
|
* @param int $doors |
|
142
|
|
|
* |
|
143
|
|
|
* @return Vehicle |
|
144
|
|
|
*/ |
|
145
|
2 |
|
public function setDoors($doors) |
|
146
|
|
|
{ |
|
147
|
2 |
|
$this->doors = $doors; |
|
148
|
2 |
|
return $this; |
|
149
|
|
|
} |
|
150
|
|
|
|
|
151
|
|
|
/** |
|
152
|
|
|
* Get Fuel |
|
153
|
|
|
* |
|
154
|
|
|
* @return string |
|
155
|
|
|
*/ |
|
156
|
2 |
|
public function getFuel() |
|
157
|
|
|
{ |
|
158
|
2 |
|
return $this->fuel; |
|
159
|
|
|
} |
|
160
|
|
|
|
|
161
|
|
|
/** |
|
162
|
|
|
* Set Fuel |
|
163
|
|
|
* |
|
164
|
|
|
* @param string $fuel |
|
165
|
|
|
* |
|
166
|
|
|
* @return Vehicle |
|
167
|
|
|
*/ |
|
168
|
2 |
|
public function setFuel($fuel) |
|
169
|
|
|
{ |
|
170
|
2 |
|
$this->fuel = $fuel; |
|
171
|
2 |
|
return $this; |
|
172
|
|
|
} |
|
173
|
|
|
|
|
174
|
|
|
/** |
|
175
|
|
|
* Get Kilometers |
|
176
|
|
|
* |
|
177
|
|
|
* @return int |
|
178
|
|
|
*/ |
|
179
|
2 |
|
public function getKilometers() |
|
180
|
|
|
{ |
|
181
|
2 |
|
return $this->kilometers; |
|
182
|
|
|
} |
|
183
|
|
|
|
|
184
|
|
|
/** |
|
185
|
|
|
* Set Kilometers |
|
186
|
|
|
* |
|
187
|
|
|
* @param int $kilometers |
|
188
|
|
|
* |
|
189
|
|
|
* @return Vehicle |
|
190
|
|
|
*/ |
|
191
|
2 |
|
public function setKilometers($kilometers) |
|
192
|
|
|
{ |
|
193
|
2 |
|
$this->kilometers = $kilometers; |
|
194
|
2 |
|
return $this; |
|
195
|
|
|
} |
|
196
|
|
|
|
|
197
|
|
|
/** |
|
198
|
|
|
* Get Model |
|
199
|
|
|
* |
|
200
|
|
|
* @return string |
|
201
|
|
|
*/ |
|
202
|
3 |
|
public function getModel() |
|
203
|
|
|
{ |
|
204
|
3 |
|
if (empty($this->model)) { |
|
205
|
1 |
|
throw new LogicException( |
|
206
|
1 |
|
sprintf(self::ERROR_MISSING_ATTRIBUTE_FORMAT, 'model') |
|
207
|
1 |
|
); |
|
208
|
|
|
} |
|
209
|
2 |
|
return $this->model; |
|
210
|
|
|
} |
|
211
|
|
|
|
|
212
|
|
|
/** |
|
213
|
|
|
* Set Model |
|
214
|
|
|
* |
|
215
|
|
|
* @param string $model |
|
216
|
|
|
* |
|
217
|
|
|
* @return Vehicle |
|
218
|
|
|
*/ |
|
219
|
2 |
|
public function setModel($model) |
|
220
|
|
|
{ |
|
221
|
2 |
|
$this->model = $model; |
|
222
|
2 |
|
return $this; |
|
223
|
|
|
} |
|
224
|
|
|
|
|
225
|
|
|
/** |
|
226
|
|
|
* Get Receives Lesser Value |
|
227
|
|
|
* |
|
228
|
|
|
* @return string |
|
229
|
|
|
*/ |
|
230
|
2 |
|
public function getReceivesLesserValue() |
|
231
|
|
|
{ |
|
232
|
2 |
|
return $this->receives_lesser_value; |
|
233
|
|
|
} |
|
234
|
|
|
|
|
235
|
|
|
/** |
|
236
|
|
|
* Set Receives Lesser Value |
|
237
|
|
|
* |
|
238
|
|
|
* @param string $receives_lesser_value |
|
239
|
|
|
* |
|
240
|
|
|
* @return Vehicle |
|
241
|
|
|
*/ |
|
242
|
2 |
|
public function setReceivesLesserValue($receives_lesser_value) |
|
243
|
|
|
{ |
|
244
|
2 |
|
$this->receives_lesser_value = $receives_lesser_value; |
|
245
|
2 |
|
return $this; |
|
246
|
|
|
} |
|
247
|
|
|
|
|
248
|
|
|
/** |
|
249
|
|
|
* Get Security |
|
250
|
|
|
* |
|
251
|
|
|
* @return string |
|
252
|
|
|
*/ |
|
253
|
2 |
|
public function getSecurity() |
|
254
|
|
|
{ |
|
255
|
2 |
|
return $this->security; |
|
256
|
|
|
} |
|
257
|
|
|
|
|
258
|
|
|
/** |
|
259
|
|
|
* Set Security |
|
260
|
|
|
* |
|
261
|
|
|
* @param string $security |
|
262
|
|
|
* |
|
263
|
|
|
* @return Vehicle |
|
264
|
|
|
*/ |
|
265
|
2 |
|
public function setSecurity($security) |
|
266
|
|
|
{ |
|
267
|
2 |
|
$this->security = $security; |
|
268
|
2 |
|
return $this; |
|
269
|
|
|
} |
|
270
|
|
|
|
|
271
|
|
|
/** |
|
272
|
|
|
* Get Segment |
|
273
|
|
|
* |
|
274
|
|
|
* @return string |
|
275
|
|
|
*/ |
|
276
|
2 |
|
public function getSegment() |
|
277
|
|
|
{ |
|
278
|
2 |
|
return $this->segment; |
|
279
|
|
|
} |
|
280
|
|
|
|
|
281
|
|
|
/** |
|
282
|
|
|
* Set Segment |
|
283
|
|
|
* |
|
284
|
|
|
* @param string $segment |
|
285
|
|
|
* |
|
286
|
|
|
* @return Vehicle |
|
287
|
|
|
*/ |
|
288
|
2 |
|
public function setSegment($segment) |
|
289
|
|
|
{ |
|
290
|
2 |
|
$this->segment = $segment; |
|
291
|
2 |
|
return $this; |
|
292
|
|
|
} |
|
293
|
|
|
|
|
294
|
|
|
/** |
|
295
|
|
|
* Get Transmission |
|
296
|
|
|
* |
|
297
|
|
|
* @return string |
|
298
|
|
|
*/ |
|
299
|
2 |
|
public function getTransmission() |
|
300
|
|
|
{ |
|
301
|
2 |
|
return $this->transmission; |
|
302
|
|
|
} |
|
303
|
|
|
|
|
304
|
|
|
/** |
|
305
|
|
|
* Set Transmission |
|
306
|
|
|
* |
|
307
|
|
|
* @param string $transmission |
|
308
|
|
|
* |
|
309
|
|
|
* @return Vehicle |
|
310
|
|
|
*/ |
|
311
|
2 |
|
public function setTransmission($transmission) |
|
312
|
|
|
{ |
|
313
|
2 |
|
$this->transmission = $transmission; |
|
314
|
2 |
|
return $this; |
|
315
|
|
|
} |
|
316
|
|
|
|
|
317
|
|
|
/** |
|
318
|
|
|
* Get Version |
|
319
|
|
|
* |
|
320
|
|
|
* @return string |
|
321
|
|
|
*/ |
|
322
|
2 |
|
public function getVersion() |
|
323
|
|
|
{ |
|
324
|
2 |
|
return $this->version; |
|
325
|
|
|
} |
|
326
|
|
|
|
|
327
|
|
|
/** |
|
328
|
|
|
* Set Version |
|
329
|
|
|
* |
|
330
|
|
|
* @param string $version |
|
331
|
|
|
* |
|
332
|
|
|
* @return Vehicle |
|
333
|
|
|
*/ |
|
334
|
2 |
|
public function setVersion($version) |
|
335
|
|
|
{ |
|
336
|
2 |
|
$this->version = $version; |
|
337
|
2 |
|
return $this; |
|
338
|
|
|
} |
|
339
|
|
|
|
|
340
|
|
|
/** |
|
341
|
|
|
* Get Year |
|
342
|
|
|
* |
|
343
|
|
|
* @return integer |
|
344
|
|
|
*/ |
|
345
|
3 |
|
public function getYear() |
|
346
|
|
|
{ |
|
347
|
3 |
|
if (empty($this->year)) { |
|
348
|
1 |
|
throw new LogicException( |
|
349
|
1 |
|
sprintf(self::ERROR_MISSING_ATTRIBUTE_FORMAT, 'year') |
|
350
|
1 |
|
); |
|
351
|
|
|
} |
|
352
|
2 |
|
return $this->year; |
|
353
|
|
|
} |
|
354
|
|
|
|
|
355
|
|
|
/** |
|
356
|
|
|
* Set Year |
|
357
|
|
|
* |
|
358
|
|
|
* @param integer $year |
|
359
|
|
|
* |
|
360
|
|
|
* @return Vehicle |
|
361
|
|
|
*/ |
|
362
|
2 |
|
public function setYear($year) |
|
363
|
|
|
{ |
|
364
|
2 |
|
$this->year = $year; |
|
365
|
2 |
|
return $this; |
|
366
|
|
|
} |
|
367
|
|
|
} |
|
368
|
|
|
|