commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-history
src
Models
Change
SetDiscountedPriceChangeModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\History\Models\Change
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use stdClass;
16
use
Commercetools\History\Models\Common\DiscountedPrice
;
17
use
Commercetools\History\Models\Common\DiscountedPriceModel
;
18
use
Commercetools\History\Models\Common\Price
;
19
use
Commercetools\History\Models\Common\PriceModel
;
20
24
final
class
SetDiscountedPriceChangeModel
extends
JsonObjectModel
implements
SetDiscountedPriceChange
25
{
26
27
public
const
DISCRIMINATOR_VALUE
=
'SetDiscountedPriceChange'
;
32
protected
$type
;
33
38
protected
$change
;
39
44
protected
$previousValue
;
45
50
protected
$nextValue
;
51
56
protected
$catalogData
;
57
62
protected
$variant
;
63
68
protected
$priceId
;
69
74
protected
$price
;
75
76
80
public
function
__construct
(
81
?
string
$change
=
null
,
82
?
DiscountedPrice
$previousValue
=
null
,
83
?
DiscountedPrice
$nextValue
=
null
,
84
?
string
$catalogData
=
null
,
85
?
string
$variant
=
null
,
86
?
string
$priceId
=
null
,
87
?
Price
$price
=
null
,
88
?
string
$type
=
null
89
) {
90
$this->change =
$change
;
91
$this->previousValue =
$previousValue
;
92
$this->nextValue =
$nextValue
;
93
$this->catalogData =
$catalogData
;
94
$this->variant =
$variant
;
95
$this->priceId =
$priceId
;
96
$this->price =
$price
;
97
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
98
}
99
104
public
function
getType
()
105
{
106
if
(is_null($this->type)) {
108
$data = $this->
raw
(self::FIELD_TYPE);
109
if
(is_null($data)) {
110
return
null
;
111
}
112
$this->type = (string) $data;
113
}
114
115
return
$this->type
;
116
}
117
122
public
function
getChange
()
123
{
124
if
(is_null($this->change)) {
126
$data = $this->
raw
(self::FIELD_CHANGE);
127
if
(is_null($data)) {
128
return
null
;
129
}
130
$this->change = (string) $data;
131
}
132
133
return
$this->change
;
134
}
135
142
public
function
getPreviousValue
()
143
{
144
if
(is_null($this->previousValue)) {
146
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
147
if
(is_null($data)) {
148
return
null
;
149
}
150
151
$this->previousValue = DiscountedPriceModel::of($data);
152
}
153
154
return
$this->previousValue
;
155
}
156
163
public
function
getNextValue
()
164
{
165
if
(is_null($this->nextValue)) {
167
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
168
if
(is_null($data)) {
169
return
null
;
170
}
171
172
$this->nextValue = DiscountedPriceModel::of($data);
173
}
174
175
return
$this->nextValue
;
176
}
177
188
public
function
getCatalogData
()
189
{
190
if
(is_null($this->catalogData)) {
192
$data = $this->
raw
(self::FIELD_CATALOG_DATA);
193
if
(is_null($data)) {
194
return
null
;
195
}
196
$this->catalogData = (string) $data;
197
}
198
199
return
$this->catalogData
;
200
}
201
209
public
function
getVariant
()
210
{
211
if
(is_null($this->variant)) {
213
$data = $this->
raw
(self::FIELD_VARIANT);
214
if
(is_null($data)) {
215
return
null
;
216
}
217
$this->variant = (string) $data;
218
}
219
220
return
$this->variant
;
221
}
222
229
public
function
getPriceId
()
230
{
231
if
(is_null($this->priceId)) {
233
$data = $this->
raw
(self::FIELD_PRICE_ID);
234
if
(is_null($data)) {
235
return
null
;
236
}
237
$this->priceId = (string) $data;
238
}
239
240
return
$this->priceId
;
241
}
242
249
public
function
getPrice
()
250
{
251
if
(is_null($this->price)) {
253
$data = $this->
raw
(self::FIELD_PRICE);
254
if
(is_null($data)) {
255
return
null
;
256
}
257
258
$this->price = PriceModel::of($data);
259
}
260
261
return
$this->price
;
262
}
263
264
268
public
function
setChange
(?
string
$change
): void
269
{
270
$this->change =
$change
;
271
}
272
276
public
function
setPreviousValue
(?
DiscountedPrice
$previousValue
): void
277
{
278
$this->previousValue =
$previousValue
;
279
}
280
284
public
function
setNextValue
(?
DiscountedPrice
$nextValue
): void
285
{
286
$this->nextValue =
$nextValue
;
287
}
288
292
public
function
setCatalogData
(?
string
$catalogData
): void
293
{
294
$this->catalogData =
$catalogData
;
295
}
296
300
public
function
setVariant
(?
string
$variant
): void
301
{
302
$this->variant =
$variant
;
303
}
304
308
public
function
setPriceId
(?
string
$priceId
): void
309
{
310
$this->priceId =
$priceId
;
311
}
312
316
public
function
setPrice
(?
Price
$price
): void
317
{
318
$this->price =
$price
;
319
}
320
321
322
323
}
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition
BaseJsonObject.php:57
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel
Definition
SetDiscountedPriceChangeModel.php:25
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\$nextValue
$nextValue
Definition
SetDiscountedPriceChangeModel.php:50
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\setPriceId
setPriceId(?string $priceId)
Definition
SetDiscountedPriceChangeModel.php:308
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\$catalogData
$catalogData
Definition
SetDiscountedPriceChangeModel.php:56
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\setPreviousValue
setPreviousValue(?DiscountedPrice $previousValue)
Definition
SetDiscountedPriceChangeModel.php:276
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\getVariant
getVariant()
Definition
SetDiscountedPriceChangeModel.php:209
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\getCatalogData
getCatalogData()
Definition
SetDiscountedPriceChangeModel.php:188
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\$type
$type
Definition
SetDiscountedPriceChangeModel.php:32
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\getPriceId
getPriceId()
Definition
SetDiscountedPriceChangeModel.php:229
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\$change
$change
Definition
SetDiscountedPriceChangeModel.php:38
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\setPrice
setPrice(?Price $price)
Definition
SetDiscountedPriceChangeModel.php:316
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
SetDiscountedPriceChangeModel.php:27
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\getPrice
getPrice()
Definition
SetDiscountedPriceChangeModel.php:249
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\getNextValue
getNextValue()
Definition
SetDiscountedPriceChangeModel.php:163
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\$priceId
$priceId
Definition
SetDiscountedPriceChangeModel.php:68
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\setChange
setChange(?string $change)
Definition
SetDiscountedPriceChangeModel.php:268
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\getPreviousValue
getPreviousValue()
Definition
SetDiscountedPriceChangeModel.php:142
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\$previousValue
$previousValue
Definition
SetDiscountedPriceChangeModel.php:44
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\__construct
__construct(?string $change=null, ?DiscountedPrice $previousValue=null, ?DiscountedPrice $nextValue=null, ?string $catalogData=null, ?string $variant=null, ?string $priceId=null, ?Price $price=null, ?string $type=null)
Definition
SetDiscountedPriceChangeModel.php:80
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\$variant
$variant
Definition
SetDiscountedPriceChangeModel.php:62
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\setVariant
setVariant(?string $variant)
Definition
SetDiscountedPriceChangeModel.php:300
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\getType
getType()
Definition
SetDiscountedPriceChangeModel.php:104
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\$price
$price
Definition
SetDiscountedPriceChangeModel.php:74
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\setNextValue
setNextValue(?DiscountedPrice $nextValue)
Definition
SetDiscountedPriceChangeModel.php:284
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\setCatalogData
setCatalogData(?string $catalogData)
Definition
SetDiscountedPriceChangeModel.php:292
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\getChange
getChange()
Definition
SetDiscountedPriceChangeModel.php:122
Commercetools\History\Models\Common\DiscountedPriceModel
Definition
DiscountedPriceModel.php:21
Commercetools\History\Models\Common\PriceModel
Definition
PriceModel.php:22
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\SetDiscountedPriceChange
Definition
SetDiscountedPriceChange.php:17
Commercetools\History\Models\Common\DiscountedPrice
Definition
DiscountedPrice.php:15
Commercetools\History\Models\Common\Price
Definition
Price.php:16
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8