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
|
|
|
public function getColor() |
88
|
|
|
{ |
89
|
|
|
return $this->color; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* Set Color |
94
|
|
|
* |
95
|
|
|
* @param string $color |
96
|
|
|
* |
97
|
|
|
* @return Vehicle |
98
|
|
|
*/ |
99
|
|
|
public function setColor($color) |
100
|
|
|
{ |
101
|
|
|
$this->color = $color; |
102
|
|
|
return $this; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* Get Confort |
107
|
|
|
* |
108
|
|
|
* @return string |
109
|
|
|
*/ |
110
|
|
|
public function getConfort() |
111
|
|
|
{ |
112
|
|
|
return $this->confort; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* Set Confort |
117
|
|
|
* |
118
|
|
|
* @param string $confort |
119
|
|
|
* |
120
|
|
|
* @return Vehicle |
121
|
|
|
*/ |
122
|
|
|
public function setConfort($confort) |
123
|
|
|
{ |
124
|
|
|
$this->confort = $confort; |
125
|
|
|
return $this; |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* Get Doors |
130
|
|
|
* |
131
|
|
|
* @return int |
132
|
|
|
*/ |
133
|
|
|
public function getDoors() |
134
|
|
|
{ |
135
|
|
|
return $this->doors; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* Set Doors |
140
|
|
|
* |
141
|
|
|
* @param int $doors |
142
|
|
|
* |
143
|
|
|
* @return Vehicle |
144
|
|
|
*/ |
145
|
|
|
public function setDoors($doors) |
146
|
|
|
{ |
147
|
|
|
$this->doors = $doors; |
148
|
|
|
return $this; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* Get Fuel |
153
|
|
|
* |
154
|
|
|
* @return string |
155
|
|
|
*/ |
156
|
|
|
public function getFuel() |
157
|
|
|
{ |
158
|
|
|
return $this->fuel; |
159
|
|
|
} |
160
|
|
|
|
161
|
|
|
/** |
162
|
|
|
* Set Fuel |
163
|
|
|
* |
164
|
|
|
* @param string $fuel |
165
|
|
|
* |
166
|
|
|
* @return Vehicle |
167
|
|
|
*/ |
168
|
|
|
public function setFuel($fuel) |
169
|
|
|
{ |
170
|
|
|
$this->fuel = $fuel; |
171
|
|
|
return $this; |
172
|
|
|
} |
173
|
|
|
|
174
|
|
|
/** |
175
|
|
|
* Get Kilometers |
176
|
|
|
* |
177
|
|
|
* @return int |
178
|
|
|
*/ |
179
|
|
|
public function getKilometers() |
180
|
|
|
{ |
181
|
|
|
return $this->kilometers; |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* Set Kilometers |
186
|
|
|
* |
187
|
|
|
* @param int $kilometers |
188
|
|
|
* |
189
|
|
|
* @return Vehicle |
190
|
|
|
*/ |
191
|
|
|
public function setKilometers($kilometers) |
192
|
|
|
{ |
193
|
|
|
$this->kilometers = $kilometers; |
194
|
|
|
return $this; |
195
|
|
|
} |
196
|
|
|
|
197
|
|
|
/** |
198
|
|
|
* Get Model |
199
|
|
|
* |
200
|
|
|
* @return string |
201
|
|
|
*/ |
202
|
|
|
public function getModel() |
203
|
|
|
{ |
204
|
|
|
if (empty($this->model)) { |
205
|
|
|
throw new LogicException( |
206
|
|
|
sprintf(self::ERROR_MISSING_ATTRIBUTE_FORMAT, 'model') |
207
|
|
|
); |
208
|
|
|
} |
209
|
|
|
return $this->model; |
210
|
|
|
} |
211
|
|
|
|
212
|
|
|
/** |
213
|
|
|
* Set Model |
214
|
|
|
* |
215
|
|
|
* @param string $model |
216
|
|
|
* |
217
|
|
|
* @return Vehicle |
218
|
|
|
*/ |
219
|
|
|
public function setModel($model) |
220
|
|
|
{ |
221
|
|
|
$this->model = $model; |
222
|
|
|
return $this; |
223
|
|
|
} |
224
|
|
|
|
225
|
|
|
/** |
226
|
|
|
* Get Receives Lesser Value |
227
|
|
|
* |
228
|
|
|
* @return string |
229
|
|
|
*/ |
230
|
|
|
public function getReceivesLesserValue() |
231
|
|
|
{ |
232
|
|
|
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
|
|
|
public function setReceivesLesserValue($receives_lesser_value) |
243
|
|
|
{ |
244
|
|
|
$this->receives_lesser_value = $receives_lesser_value; |
245
|
|
|
return $this; |
246
|
|
|
} |
247
|
|
|
|
248
|
|
|
/** |
249
|
|
|
* Get Security |
250
|
|
|
* |
251
|
|
|
* @return string |
252
|
|
|
*/ |
253
|
|
|
public function getSecurity() |
254
|
|
|
{ |
255
|
|
|
return $this->security; |
256
|
|
|
} |
257
|
|
|
|
258
|
|
|
/** |
259
|
|
|
* Set Security |
260
|
|
|
* |
261
|
|
|
* @param string $security |
262
|
|
|
* |
263
|
|
|
* @return Vehicle |
264
|
|
|
*/ |
265
|
|
|
public function setSecurity($security) |
266
|
|
|
{ |
267
|
|
|
$this->security = $security; |
268
|
|
|
return $this; |
269
|
|
|
} |
270
|
|
|
|
271
|
|
|
/** |
272
|
|
|
* Get Segment |
273
|
|
|
* |
274
|
|
|
* @return string |
275
|
|
|
*/ |
276
|
|
|
public function getSegment() |
277
|
|
|
{ |
278
|
|
|
return $this->segment; |
279
|
|
|
} |
280
|
|
|
|
281
|
|
|
/** |
282
|
|
|
* Set Segment |
283
|
|
|
* |
284
|
|
|
* @param string $segment |
285
|
|
|
* |
286
|
|
|
* @return Vehicle |
287
|
|
|
*/ |
288
|
|
|
public function setSegment($segment) |
289
|
|
|
{ |
290
|
|
|
$this->segment = $segment; |
291
|
|
|
return $this; |
292
|
|
|
} |
293
|
|
|
|
294
|
|
|
/** |
295
|
|
|
* Get Transmission |
296
|
|
|
* |
297
|
|
|
* @return string |
298
|
|
|
*/ |
299
|
|
|
public function getTransmission() |
300
|
|
|
{ |
301
|
|
|
return $this->transmission; |
302
|
|
|
} |
303
|
|
|
|
304
|
|
|
/** |
305
|
|
|
* Set Transmission |
306
|
|
|
* |
307
|
|
|
* @param string $transmission |
308
|
|
|
* |
309
|
|
|
* @return Vehicle |
310
|
|
|
*/ |
311
|
|
|
public function setTransmission($transmission) |
312
|
|
|
{ |
313
|
|
|
$this->transmission = $transmission; |
314
|
|
|
return $this; |
315
|
|
|
} |
316
|
|
|
|
317
|
|
|
/** |
318
|
|
|
* Get Version |
319
|
|
|
* |
320
|
|
|
* @return string |
321
|
|
|
*/ |
322
|
|
|
public function getVersion() |
323
|
|
|
{ |
324
|
|
|
return $this->version; |
325
|
|
|
} |
326
|
|
|
|
327
|
|
|
/** |
328
|
|
|
* Set Version |
329
|
|
|
* |
330
|
|
|
* @param string $version |
331
|
|
|
* |
332
|
|
|
* @return Vehicle |
333
|
|
|
*/ |
334
|
|
|
public function setVersion($version) |
335
|
|
|
{ |
336
|
|
|
$this->version = $version; |
337
|
|
|
return $this; |
338
|
|
|
} |
339
|
|
|
|
340
|
|
|
/** |
341
|
|
|
* Get Year |
342
|
|
|
* |
343
|
|
|
* @return integer |
344
|
|
|
*/ |
345
|
|
|
public function getYear() |
346
|
|
|
{ |
347
|
|
|
if (empty($this->year)) { |
348
|
|
|
throw new LogicException( |
349
|
|
|
sprintf(self::ERROR_MISSING_ATTRIBUTE_FORMAT, 'year') |
350
|
|
|
); |
351
|
|
|
} |
352
|
|
|
return $this->year; |
353
|
|
|
} |
354
|
|
|
|
355
|
|
|
/** |
356
|
|
|
* Set Year |
357
|
|
|
* |
358
|
|
|
* @param integer $year |
359
|
|
|
* |
360
|
|
|
* @return Vehicle |
361
|
|
|
*/ |
362
|
|
|
public function setYear($year) |
363
|
|
|
{ |
364
|
|
|
$this->year = $year; |
365
|
|
|
return $this; |
366
|
|
|
} |
367
|
|
|
} |
368
|
|
|
|