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
SetPricesChangeModel.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\PriceCollection
;
17
21
final
class
SetPricesChangeModel
extends
JsonObjectModel
implements
SetPricesChange
22
{
23
24
public
const
DISCRIMINATOR_VALUE
=
'SetPricesChange'
;
29
protected
$type
;
30
35
protected
$change
;
36
41
protected
$previousValue
;
42
47
protected
$nextValue
;
48
53
protected
$catalogData
;
54
59
protected
$variant
;
60
65
protected
$addedItems
;
66
71
protected
$removedItems
;
72
73
77
public
function
__construct
(
78
?
string
$change
=
null
,
79
?
PriceCollection
$previousValue
=
null
,
80
?
PriceCollection
$nextValue
=
null
,
81
?
string
$catalogData
=
null
,
82
?
string
$variant
=
null
,
83
?
PriceCollection
$addedItems
=
null
,
84
?
PriceCollection
$removedItems
=
null
,
85
?
string
$type
=
null
86
) {
87
$this->change =
$change
;
88
$this->previousValue =
$previousValue
;
89
$this->nextValue =
$nextValue
;
90
$this->catalogData =
$catalogData
;
91
$this->variant =
$variant
;
92
$this->addedItems =
$addedItems
;
93
$this->removedItems =
$removedItems
;
94
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
95
}
96
101
public
function
getType
()
102
{
103
if
(is_null($this->type)) {
105
$data = $this->
raw
(self::FIELD_TYPE);
106
if
(is_null($data)) {
107
return
null
;
108
}
109
$this->type = (string) $data;
110
}
111
112
return
$this->type
;
113
}
114
119
public
function
getChange
()
120
{
121
if
(is_null($this->change)) {
123
$data = $this->
raw
(self::FIELD_CHANGE);
124
if
(is_null($data)) {
125
return
null
;
126
}
127
$this->change = (string) $data;
128
}
129
130
return
$this->change
;
131
}
132
139
public
function
getPreviousValue
()
140
{
141
if
(is_null($this->previousValue)) {
143
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
144
if
(is_null($data)) {
145
return
null
;
146
}
147
$this->previousValue = PriceCollection::fromArray($data);
148
}
149
150
return
$this->previousValue
;
151
}
152
159
public
function
getNextValue
()
160
{
161
if
(is_null($this->nextValue)) {
163
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
164
if
(is_null($data)) {
165
return
null
;
166
}
167
$this->nextValue = PriceCollection::fromArray($data);
168
}
169
170
return
$this->nextValue
;
171
}
172
183
public
function
getCatalogData
()
184
{
185
if
(is_null($this->catalogData)) {
187
$data = $this->
raw
(self::FIELD_CATALOG_DATA);
188
if
(is_null($data)) {
189
return
null
;
190
}
191
$this->catalogData = (string) $data;
192
}
193
194
return
$this->catalogData
;
195
}
196
204
public
function
getVariant
()
205
{
206
if
(is_null($this->variant)) {
208
$data = $this->
raw
(self::FIELD_VARIANT);
209
if
(is_null($data)) {
210
return
null
;
211
}
212
$this->variant = (string) $data;
213
}
214
215
return
$this->variant
;
216
}
217
224
public
function
getAddedItems
()
225
{
226
if
(is_null($this->addedItems)) {
228
$data = $this->
raw
(self::FIELD_ADDED_ITEMS);
229
if
(is_null($data)) {
230
return
null
;
231
}
232
$this->addedItems = PriceCollection::fromArray($data);
233
}
234
235
return
$this->addedItems
;
236
}
237
244
public
function
getRemovedItems
()
245
{
246
if
(is_null($this->removedItems)) {
248
$data = $this->
raw
(self::FIELD_REMOVED_ITEMS);
249
if
(is_null($data)) {
250
return
null
;
251
}
252
$this->removedItems = PriceCollection::fromArray($data);
253
}
254
255
return
$this->removedItems
;
256
}
257
258
262
public
function
setChange
(?
string
$change
): void
263
{
264
$this->change =
$change
;
265
}
266
270
public
function
setPreviousValue
(?
PriceCollection
$previousValue
): void
271
{
272
$this->previousValue =
$previousValue
;
273
}
274
278
public
function
setNextValue
(?
PriceCollection
$nextValue
): void
279
{
280
$this->nextValue =
$nextValue
;
281
}
282
286
public
function
setCatalogData
(?
string
$catalogData
): void
287
{
288
$this->catalogData =
$catalogData
;
289
}
290
294
public
function
setVariant
(?
string
$variant
): void
295
{
296
$this->variant =
$variant
;
297
}
298
302
public
function
setAddedItems
(?
PriceCollection
$addedItems
): void
303
{
304
$this->addedItems =
$addedItems
;
305
}
306
310
public
function
setRemovedItems
(?
PriceCollection
$removedItems
): void
311
{
312
$this->removedItems =
$removedItems
;
313
}
314
315
316
317
}
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\SetPricesChangeModel
Definition
SetPricesChangeModel.php:22
Commercetools\History\Models\Change\SetPricesChangeModel\setNextValue
setNextValue(?PriceCollection $nextValue)
Definition
SetPricesChangeModel.php:278
Commercetools\History\Models\Change\SetPricesChangeModel\$nextValue
$nextValue
Definition
SetPricesChangeModel.php:47
Commercetools\History\Models\Change\SetPricesChangeModel\setRemovedItems
setRemovedItems(?PriceCollection $removedItems)
Definition
SetPricesChangeModel.php:310
Commercetools\History\Models\Change\SetPricesChangeModel\$variant
$variant
Definition
SetPricesChangeModel.php:59
Commercetools\History\Models\Change\SetPricesChangeModel\getType
getType()
Definition
SetPricesChangeModel.php:101
Commercetools\History\Models\Change\SetPricesChangeModel\setChange
setChange(?string $change)
Definition
SetPricesChangeModel.php:262
Commercetools\History\Models\Change\SetPricesChangeModel\$addedItems
$addedItems
Definition
SetPricesChangeModel.php:65
Commercetools\History\Models\Change\SetPricesChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
SetPricesChangeModel.php:24
Commercetools\History\Models\Change\SetPricesChangeModel\getNextValue
getNextValue()
Definition
SetPricesChangeModel.php:159
Commercetools\History\Models\Change\SetPricesChangeModel\$catalogData
$catalogData
Definition
SetPricesChangeModel.php:53
Commercetools\History\Models\Change\SetPricesChangeModel\setVariant
setVariant(?string $variant)
Definition
SetPricesChangeModel.php:294
Commercetools\History\Models\Change\SetPricesChangeModel\getChange
getChange()
Definition
SetPricesChangeModel.php:119
Commercetools\History\Models\Change\SetPricesChangeModel\getPreviousValue
getPreviousValue()
Definition
SetPricesChangeModel.php:139
Commercetools\History\Models\Change\SetPricesChangeModel\$type
$type
Definition
SetPricesChangeModel.php:29
Commercetools\History\Models\Change\SetPricesChangeModel\setAddedItems
setAddedItems(?PriceCollection $addedItems)
Definition
SetPricesChangeModel.php:302
Commercetools\History\Models\Change\SetPricesChangeModel\getVariant
getVariant()
Definition
SetPricesChangeModel.php:204
Commercetools\History\Models\Change\SetPricesChangeModel\setCatalogData
setCatalogData(?string $catalogData)
Definition
SetPricesChangeModel.php:286
Commercetools\History\Models\Change\SetPricesChangeModel\setPreviousValue
setPreviousValue(?PriceCollection $previousValue)
Definition
SetPricesChangeModel.php:270
Commercetools\History\Models\Change\SetPricesChangeModel\$removedItems
$removedItems
Definition
SetPricesChangeModel.php:71
Commercetools\History\Models\Change\SetPricesChangeModel\getRemovedItems
getRemovedItems()
Definition
SetPricesChangeModel.php:244
Commercetools\History\Models\Change\SetPricesChangeModel\$previousValue
$previousValue
Definition
SetPricesChangeModel.php:41
Commercetools\History\Models\Change\SetPricesChangeModel\getCatalogData
getCatalogData()
Definition
SetPricesChangeModel.php:183
Commercetools\History\Models\Change\SetPricesChangeModel\getAddedItems
getAddedItems()
Definition
SetPricesChangeModel.php:224
Commercetools\History\Models\Change\SetPricesChangeModel\__construct
__construct(?string $change=null, ?PriceCollection $previousValue=null, ?PriceCollection $nextValue=null, ?string $catalogData=null, ?string $variant=null, ?PriceCollection $addedItems=null, ?PriceCollection $removedItems=null, ?string $type=null)
Definition
SetPricesChangeModel.php:77
Commercetools\History\Models\Change\SetPricesChangeModel\$change
$change
Definition
SetPricesChangeModel.php:35
Commercetools\History\Models\Common\PriceCollection
Definition
PriceCollection.php:22
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\SetPricesChange
Definition
SetPricesChange.php:16
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8