Completed
Push — master ( b73efb...175f05 )
by Bukashk0zzz
03:39
created

AbstractOffer::setManufacturerWarranty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Bukashk0zzzYmlGenerator
5
 *
6
 * (c) Denis Golubovskiy <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Bukashk0zzz\YmlGenerator\Model\Offer;
13
14
/**
15
 * Abstract Class Offer
16
 *
17
 * @author Denis Golubovskiy <[email protected]>
18
 */
19
abstract class AbstractOffer implements OfferInterface
20
{
21
    /**
22
     * @var string
23
     */
24
    private $id;
25
26
    /**
27
     * @var bool
28
     */
29
    private $available;
30
31
    /**
32
     * @var string
33
     */
34
    private $url;
35
36
    /**
37
     * @var float
38
     */
39
    private $price;
40
41
    /**
42
     * @var string
43
     */
44
    private $currencyId;
45
46
    /**
47
     * @var int
48
     */
49
    private $categoryId;
50
51
    /**
52
     * @var bool
53
     */
54
    private $adult;
55
56
    /**
57
     * @var string
58
     */
59
    private $salesNotes;
60
61
    /**
62
     * @var bool
63
     */
64
    private $manufacturerWarranty;
65
66
    /**
67
     * @var bool
68
     */
69
    private $downloadable;
70
71
    /**
72
     * @var bool
73
     */
74
    private $delivery;
75
76
    /**
77
     * @var float
78
     */
79
    private $localDeliveryCost;
80
81
    /**
82
     * @var string
83
     */
84
    private $description;
85
86
    /**
87
     * @var string
88
     */
89
    private $countryOfOrigin;
90
91
    /**
92
     * @var array
93
     */
94
    private $params = [];
95
96
    /**
97
     * @return array
98
     */
99
    public function getHeaderOptions()
100
    {
101
        return [
102
            'url' => $this->getUrl(),
103
            'price' => $this->getPrice(),
104
            'currencyId' => $this->getCurrencyId(),
105
            'categoryId' => $this->getCategoryId(),
106
            'delivery' => $this->isDelivery(),
107
            'local_delivery_cost' => $this->getLocalDeliveryCost(),
108
        ];
109
    }
110
111
    /**
112
     * @return array
113
     */
114
    public function getFooterOptions()
115
    {
116
        return [
117
            'description' => $this->getDescription(),
118
            'sales_notes' => $this->getSalesNotes(),
119
            'manufacturer_warranty' => $this->isManufacturerWarranty(),
120
            'country_of_origin' => $this->getCountryOfOrigin(),
121
            'downloadable' => $this->isDownloadable(),
122
            'adult' => $this->isAdult(),
123
        ];
124
    }
125
126
    /**
127
     * @return string
128
     */
129
    public function getId()
130
    {
131
        return $this->id;
132
    }
133
134
    /**
135
     * @param string $id
136
     * @return $this
137
     */
138
    public function setId($id)
139
    {
140
        $this->id = $id;
141
142
        return $this;
143
    }
144
145
    /**
146
     * @return boolean
147
     */
148
    public function isAvailable()
149
    {
150
        return $this->available;
151
    }
152
153
    /**
154
     * @param boolean $available
155
     * @return $this
156
     */
157
    public function setAvailable($available)
158
    {
159
        $this->available = $available;
160
161
        return $this;
162
    }
163
164
    /**
165
     * @return string
166
     */
167
    public function getUrl()
168
    {
169
        return $this->url;
170
    }
171
172
    /**
173
     * @param string $url
174
     * @return $this
175
     */
176
    public function setUrl($url)
177
    {
178
        $this->url = $url;
179
180
        return $this;
181
    }
182
183
    /**
184
     * @return float
185
     */
186
    public function getPrice()
187
    {
188
        return $this->price;
189
    }
190
191
    /**
192
     * @param float $price
193
     * @return $this
194
     */
195
    public function setPrice($price)
196
    {
197
        $this->price = $price;
198
199
        return $this;
200
    }
201
202
    /**
203
     * @return string
204
     */
205
    public function getCurrencyId()
206
    {
207
        return $this->currencyId;
208
    }
209
210
    /**
211
     * @param string $currencyId
212
     * @return $this
213
     */
214
    public function setCurrencyId($currencyId)
215
    {
216
        $this->currencyId = $currencyId;
217
218
        return $this;
219
    }
220
221
    /**
222
     * @return int
223
     */
224
    public function getCategoryId()
225
    {
226
        return $this->categoryId;
227
    }
228
229
    /**
230
     * @param int $categoryId
231
     * @return $this
232
     */
233
    public function setCategoryId($categoryId)
234
    {
235
        $this->categoryId = $categoryId;
236
237
        return $this;
238
    }
239
240
    /**
241
     * @return boolean
242
     */
243
    public function isAdult()
244
    {
245
        return $this->adult;
246
    }
247
248
    /**
249
     * @param boolean $adult
250
     * @return $this
251
     */
252
    public function setAdult($adult)
253
    {
254
        $this->adult = $adult;
255
256
        return $this;
257
    }
258
259
    /**
260
     * @return string
261
     */
262
    public function getSalesNotes()
263
    {
264
        return $this->salesNotes;
265
    }
266
267
    /**
268
     * @param string $salesNotes
269
     * @return $this
270
     */
271
    public function setSalesNotes($salesNotes)
272
    {
273
        $this->salesNotes = $salesNotes;
274
275
        return $this;
276
    }
277
278
    /**
279
     * @return boolean
280
     */
281
    public function isManufacturerWarranty()
282
    {
283
        return $this->manufacturerWarranty;
284
    }
285
286
    /**
287
     * @param boolean $manufacturerWarranty
288
     * @return $this
289
     */
290
    public function setManufacturerWarranty($manufacturerWarranty)
291
    {
292
        $this->manufacturerWarranty = $manufacturerWarranty;
293
294
        return $this;
295
    }
296
297
    /**
298
     * @return boolean
299
     */
300
    public function isDownloadable()
301
    {
302
        return $this->downloadable;
303
    }
304
305
    /**
306
     * @param boolean $downloadable
307
     * @return $this
308
     */
309
    public function setDownloadable($downloadable)
310
    {
311
        $this->downloadable = $downloadable;
312
313
        return $this;
314
    }
315
316
    /**
317
     * @return boolean
318
     */
319
    public function isDelivery()
320
    {
321
        return $this->delivery;
322
    }
323
324
    /**
325
     * @param boolean $delivery
326
     * @return $this
327
     */
328
    public function setDelivery($delivery)
329
    {
330
        $this->delivery = $delivery;
331
332
        return $this;
333
    }
334
335
    /**
336
     * @return float
337
     */
338
    public function getLocalDeliveryCost()
339
    {
340
        return $this->localDeliveryCost;
341
    }
342
343
    /**
344
     * @param float $localDeliveryCost
345
     * @return $this
346
     */
347
    public function setLocalDeliveryCost($localDeliveryCost)
348
    {
349
        $this->localDeliveryCost = $localDeliveryCost;
350
351
        return $this;
352
    }
353
354
    /**
355
     * @return string
356
     */
357
    public function getDescription()
358
    {
359
        return $this->description;
360
    }
361
362
    /**
363
     * @param string $description
364
     * @return $this
365
     */
366
    public function setDescription($description)
367
    {
368
        $this->description = $description;
369
370
        return $this;
371
    }
372
373
    /**
374
     * @return string
375
     */
376
    public function getCountryOfOrigin()
377
    {
378
        return $this->countryOfOrigin;
379
    }
380
381
    /**
382
     * @param string $countryOfOrigin
383
     * @return $this
384
     */
385
    public function setCountryOfOrigin($countryOfOrigin)
386
    {
387
        $this->countryOfOrigin = $countryOfOrigin;
388
389
        return $this;
390
    }
391
392
    /**
393
     * @return array
394
     */
395
    public function getParams()
396
    {
397
        return $this->params;
398
    }
399
400
    /**
401
     * @param OfferParam $param
402
     * @return $this
403
     */
404
    public function addParam(OfferParam $param)
405
    {
406
        $this->params[] = $param;
407
408
        return $this;
409
    }
410
}
411