Completed
Push — master ( 0f7b01...b73efb )
by Bukashk0zzz
02:11
created

OfferCustom::addParam()   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
 * Class OfferCustom
16
 *
17
 * @author Denis Golubovskiy <[email protected]>
18
 */
19
class OfferCustom extends OfferSimple
20
{
21
    /**
22
     * @var string
23
     */
24
    private $typePrefix;
25
26
    /**
27
     * @var string
28
     */
29
    private $model;
30
31
    /**
32
     * @var string
33
     */
34
    private $salesNotes;
35
36
    /**
37
     * @var bool
38
     */
39
    private $manufacturerWarranty;
40
41
    /**
42
     * @var bool
43
     */
44
    private $downloadable;
45
46
    /**
47
     * @var array
48
     */
49
    private $params;
50
51
    /**
52
     * @return array
53
     */
54
    public function toArray()
55
    {
56
        return [
57
            'url' => $this->getUrl(),
58
            'price' => $this->getPrice(),
59
            'currencyId' => $this->getCurrencyId(),
60
            'categoryId' => $this->getCategoryId(),
61
62
            'delivery' => $this->isDelivery(),
63
            'local_delivery_cost' => $this->getLocalDeliveryCost(),
64
            'typePrefix' => $this->getTypePrefix(),
65
            'vendor' => $this->getVendor(),
66
            'vendorCode' => $this->getVendorCode(),
67
            'model' => $this->getModel(),
68
            'description' => $this->getDescription(),
69
            'sales_notes' => $this->getSalesNotes(),
70
            'manufacturer_warranty' => $this->isManufacturerWarranty(),
71
            'country_of_origin' => $this->getCountryOfOrigin(),
72
            'downloadable' => $this->isDownloadable(),
73
            'adult' => $this->isAdult(),
74
        ];
75
    }
76
77
    /**
78
     * @return string
79
     */
80
    public function getType()
81
    {
82
        return 'vendor.model';
83
    }
84
85
    /**
86
     * @return string
87
     */
88
    public function getTypePrefix()
89
    {
90
        return $this->typePrefix;
91
    }
92
93
    /**
94
     * @param string $typePrefix
95
     * @return $this
96
     */
97
    public function setTypePrefix($typePrefix)
98
    {
99
        $this->typePrefix = $typePrefix;
100
101
        return $this;
102
    }
103
104
    /**
105
     * @return string
106
     */
107
    public function getModel()
108
    {
109
        return $this->model;
110
    }
111
112
    /**
113
     * @param string $model
114
     * @return $this
115
     */
116
    public function setModel($model)
117
    {
118
        $this->model = $model;
119
120
        return $this;
121
    }
122
123
    /**
124
     * @return string
125
     */
126
    public function getSalesNotes()
127
    {
128
        return $this->salesNotes;
129
    }
130
131
    /**
132
     * @param string $salesNotes
133
     * @return $this
134
     */
135
    public function setSalesNotes($salesNotes)
136
    {
137
        $this->salesNotes = $salesNotes;
138
139
        return $this;
140
    }
141
142
    /**
143
     * @return boolean
144
     */
145
    public function isManufacturerWarranty()
146
    {
147
        return $this->manufacturerWarranty;
148
    }
149
150
    /**
151
     * @param boolean $manufacturerWarranty
152
     * @return $this
153
     */
154
    public function setManufacturerWarranty($manufacturerWarranty)
155
    {
156
        $this->manufacturerWarranty = $manufacturerWarranty;
157
158
        return $this;
159
    }
160
161
    /**
162
     * @return boolean
163
     */
164
    public function isDownloadable()
165
    {
166
        return $this->downloadable;
167
    }
168
169
    /**
170
     * @param boolean $downloadable
171
     * @return $this
172
     */
173
    public function setDownloadable($downloadable)
174
    {
175
        $this->downloadable = $downloadable;
176
177
        return $this;
178
    }
179
180
    /**
181
     * @return array
182
     */
183
    public function getParams()
184
    {
185
        return $this->params;
186
    }
187
188
    /**
189
     * @param OfferParam $param
190
     * @return $this
191
     */
192
    public function addParam(OfferParam $param)
193
    {
194
        $this->params[] = $param;
195
196
        return $this;
197
    }
198
}
199