|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Yandex PHP Library |
|
4
|
|
|
* |
|
5
|
|
|
* @copyright NIX Solutions Ltd. |
|
6
|
|
|
* @link https://github.com/nixsolutions/yandex-php-library |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
namespace Yandex\Market\Partner\Models; |
|
10
|
|
|
|
|
11
|
|
|
use Yandex\Common\Model; |
|
12
|
|
|
|
|
13
|
|
|
class MarketModelOffer extends Model |
|
14
|
|
|
{ |
|
15
|
|
|
/** |
|
16
|
|
|
* @var int |
|
17
|
|
|
*/ |
|
18
|
|
|
protected $discount; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* @var int |
|
22
|
|
|
*/ |
|
23
|
|
|
protected $inStock; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* @var string |
|
27
|
|
|
*/ |
|
28
|
|
|
protected $name; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @var int |
|
32
|
|
|
*/ |
|
33
|
|
|
protected $pos; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @var float |
|
37
|
|
|
*/ |
|
38
|
|
|
protected $preDiscountPrice; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @var float |
|
42
|
|
|
*/ |
|
43
|
|
|
protected $price; |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* @var int |
|
47
|
|
|
*/ |
|
48
|
|
|
protected $regionId; |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* @var float |
|
52
|
|
|
*/ |
|
53
|
|
|
protected $shippingCost; |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @var string |
|
57
|
|
|
*/ |
|
58
|
|
|
protected $shopName; |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @var int |
|
62
|
|
|
*/ |
|
63
|
|
|
protected $shopRating; |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* Get percent of discount |
|
67
|
|
|
* |
|
68
|
|
|
* @return int|null |
|
69
|
|
|
*/ |
|
70
|
|
|
public function getDiscount() |
|
71
|
|
|
{ |
|
72
|
|
|
return $this->discount; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* Set percent of discount |
|
77
|
|
|
* |
|
78
|
|
|
* @param int $discount |
|
79
|
|
|
* @return MarketModelOffer |
|
80
|
|
|
*/ |
|
81
|
|
|
public function setDiscount($discount) |
|
82
|
|
|
{ |
|
83
|
|
|
$this->discount = $discount; |
|
84
|
|
|
return $this; |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
/** |
|
88
|
|
|
* Get in stock flag (0 - on request, 1 - in stock) |
|
89
|
|
|
* |
|
90
|
|
|
* @return int |
|
91
|
|
|
*/ |
|
92
|
2 |
|
public function getInStock() |
|
93
|
|
|
{ |
|
94
|
2 |
|
return $this->inStock; |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
/** |
|
98
|
|
|
* Set in stock flag (0 - on request, 1 - in stock) |
|
99
|
|
|
* |
|
100
|
|
|
* @param int $inStock |
|
101
|
|
|
* @return MarketModelOffer |
|
102
|
|
|
*/ |
|
103
|
|
|
public function setInStock($inStock) |
|
104
|
|
|
{ |
|
105
|
|
|
$this->inStock = $inStock; |
|
106
|
|
|
return $this; |
|
107
|
|
|
} |
|
108
|
|
|
|
|
109
|
|
|
/** |
|
110
|
|
|
* Get name |
|
111
|
|
|
* |
|
112
|
|
|
* @return string |
|
113
|
|
|
*/ |
|
114
|
2 |
|
public function getName() |
|
115
|
|
|
{ |
|
116
|
2 |
|
return $this->name; |
|
117
|
|
|
} |
|
118
|
|
|
|
|
119
|
|
|
/** |
|
120
|
|
|
* Set name |
|
121
|
|
|
* |
|
122
|
|
|
* @param string $name |
|
123
|
|
|
* @return MarketModelOffer |
|
124
|
|
|
*/ |
|
125
|
|
|
public function setName($name) |
|
126
|
|
|
{ |
|
127
|
|
|
$this->name = $name; |
|
128
|
|
|
return $this; |
|
129
|
|
|
} |
|
130
|
|
|
|
|
131
|
|
|
/** |
|
132
|
|
|
* Get search result position |
|
133
|
|
|
* |
|
134
|
|
|
* @return int |
|
135
|
|
|
*/ |
|
136
|
2 |
|
public function getPos() |
|
137
|
|
|
{ |
|
138
|
2 |
|
return $this->pos; |
|
139
|
|
|
} |
|
140
|
|
|
|
|
141
|
|
|
/** |
|
142
|
|
|
* Set search result position |
|
143
|
|
|
* |
|
144
|
|
|
* @param int $pos |
|
145
|
|
|
* @return MarketModelOffer |
|
146
|
|
|
*/ |
|
147
|
|
|
public function setPos($pos) |
|
148
|
|
|
{ |
|
149
|
|
|
$this->pos = $pos; |
|
150
|
|
|
return $this; |
|
151
|
|
|
} |
|
152
|
|
|
|
|
153
|
|
|
/** |
|
154
|
|
|
* Get price excluding discount |
|
155
|
|
|
* |
|
156
|
|
|
* @return float|null |
|
157
|
|
|
*/ |
|
158
|
|
|
public function getPreDiscountPrice() |
|
159
|
|
|
{ |
|
160
|
|
|
return $this->preDiscountPrice; |
|
161
|
|
|
} |
|
162
|
|
|
|
|
163
|
|
|
/** |
|
164
|
|
|
* Set price excluding discount |
|
165
|
|
|
* |
|
166
|
|
|
* @param float $preDiscountPrice |
|
167
|
|
|
* @return MarketModelOffer |
|
168
|
|
|
*/ |
|
169
|
|
|
public function setPreDiscountPrice($preDiscountPrice) |
|
170
|
|
|
{ |
|
171
|
|
|
$this->preDiscountPrice = $preDiscountPrice; |
|
172
|
|
|
return $this; |
|
173
|
|
|
} |
|
174
|
|
|
|
|
175
|
|
|
/** |
|
176
|
|
|
* Get price |
|
177
|
|
|
* |
|
178
|
|
|
* @return float |
|
179
|
|
|
*/ |
|
180
|
2 |
|
public function getPrice() |
|
181
|
|
|
{ |
|
182
|
2 |
|
return $this->price; |
|
183
|
|
|
} |
|
184
|
|
|
|
|
185
|
|
|
/** |
|
186
|
|
|
* Set price |
|
187
|
|
|
* |
|
188
|
|
|
* @param float $price |
|
189
|
|
|
* @return MarketModelOffer |
|
190
|
|
|
*/ |
|
191
|
|
|
public function setPrice($price) |
|
192
|
|
|
{ |
|
193
|
|
|
$this->price = $price; |
|
194
|
|
|
return $this; |
|
195
|
|
|
} |
|
196
|
|
|
|
|
197
|
|
|
/** |
|
198
|
|
|
* Get region ID |
|
199
|
|
|
* |
|
200
|
|
|
* @return int |
|
201
|
|
|
*/ |
|
202
|
2 |
|
public function getRegionId() |
|
203
|
|
|
{ |
|
204
|
2 |
|
return $this->regionId; |
|
205
|
|
|
} |
|
206
|
|
|
|
|
207
|
|
|
/** |
|
208
|
|
|
* Set region ID |
|
209
|
|
|
* |
|
210
|
|
|
* @param int $regionId |
|
211
|
|
|
* @return MarketModelOffer |
|
212
|
|
|
*/ |
|
213
|
|
|
public function setRegionId($regionId) |
|
214
|
|
|
{ |
|
215
|
|
|
$this->regionId = $regionId; |
|
216
|
|
|
return $this; |
|
217
|
|
|
} |
|
218
|
|
|
|
|
219
|
|
|
/** |
|
220
|
|
|
* Get shipping cost |
|
221
|
|
|
* |
|
222
|
|
|
* @return float |
|
223
|
|
|
*/ |
|
224
|
2 |
|
public function getShippingCost() |
|
225
|
|
|
{ |
|
226
|
2 |
|
return $this->shippingCost; |
|
227
|
|
|
} |
|
228
|
|
|
|
|
229
|
|
|
/** |
|
230
|
|
|
* Set shipping cost |
|
231
|
|
|
* |
|
232
|
|
|
* @param float $shippingCost |
|
233
|
|
|
* @return MarketModelOffer |
|
234
|
|
|
*/ |
|
235
|
|
|
public function setShippingCost($shippingCost) |
|
236
|
|
|
{ |
|
237
|
|
|
$this->shippingCost = $shippingCost; |
|
238
|
|
|
return $this; |
|
239
|
|
|
} |
|
240
|
|
|
|
|
241
|
|
|
/** |
|
242
|
|
|
* Get shop name |
|
243
|
|
|
* |
|
244
|
|
|
* @return string |
|
245
|
|
|
*/ |
|
246
|
2 |
|
public function getShopName() |
|
247
|
|
|
{ |
|
248
|
2 |
|
return $this->shopName; |
|
249
|
|
|
} |
|
250
|
|
|
|
|
251
|
|
|
/** |
|
252
|
|
|
* Set shop name |
|
253
|
|
|
* |
|
254
|
|
|
* @param string $shopName |
|
255
|
|
|
* @return MarketModelOffer |
|
256
|
|
|
*/ |
|
257
|
|
|
public function setShopName($shopName) |
|
258
|
|
|
{ |
|
259
|
|
|
$this->shopName = $shopName; |
|
260
|
|
|
return $this; |
|
261
|
|
|
} |
|
262
|
|
|
|
|
263
|
|
|
/** |
|
264
|
|
|
* Get shop rating (1 - 5) |
|
265
|
|
|
* |
|
266
|
|
|
* @return int |
|
267
|
|
|
*/ |
|
268
|
|
|
public function getShopRating() |
|
269
|
|
|
{ |
|
270
|
|
|
return $this->shopRating; |
|
271
|
|
|
} |
|
272
|
|
|
|
|
273
|
|
|
/** |
|
274
|
|
|
* Set shop rating (1 - 5) |
|
275
|
|
|
* |
|
276
|
|
|
* @param int $shopRating |
|
277
|
|
|
* @return MarketModelOffer |
|
278
|
|
|
*/ |
|
279
|
|
|
public function setShopRating($shopRating) |
|
280
|
|
|
{ |
|
281
|
|
|
$this->shopRating = $shopRating; |
|
282
|
|
|
return $this; |
|
283
|
|
|
} |
|
284
|
|
|
} |
|
285
|
|
|
|