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
61
65
public
function
__construct
(
66
?
string
$change
=
null
,
67
?
PriceCollection
$previousValue
=
null
,
68
?
PriceCollection
$nextValue
=
null
,
69
?
string
$catalogData
=
null
,
70
?
string
$variant
=
null
,
71
?
string
$type
=
null
72
) {
73
$this->change =
$change
;
74
$this->previousValue =
$previousValue
;
75
$this->nextValue =
$nextValue
;
76
$this->catalogData =
$catalogData
;
77
$this->variant =
$variant
;
78
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
79
}
80
85
public
function
getType
()
86
{
87
if
(is_null($this->type)) {
89
$data = $this->
raw
(self::FIELD_TYPE);
90
if
(is_null($data)) {
91
return
null
;
92
}
93
$this->type = (string) $data;
94
}
95
96
return
$this->type
;
97
}
98
103
public
function
getChange
()
104
{
105
if
(is_null($this->change)) {
107
$data = $this->
raw
(self::FIELD_CHANGE);
108
if
(is_null($data)) {
109
return
null
;
110
}
111
$this->change = (string) $data;
112
}
113
114
return
$this->change
;
115
}
116
123
public
function
getPreviousValue
()
124
{
125
if
(is_null($this->previousValue)) {
127
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
128
if
(is_null($data)) {
129
return
null
;
130
}
131
$this->previousValue = PriceCollection::fromArray($data);
132
}
133
134
return
$this->previousValue
;
135
}
136
143
public
function
getNextValue
()
144
{
145
if
(is_null($this->nextValue)) {
147
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
148
if
(is_null($data)) {
149
return
null
;
150
}
151
$this->nextValue = PriceCollection::fromArray($data);
152
}
153
154
return
$this->nextValue
;
155
}
156
166
public
function
getCatalogData
()
167
{
168
if
(is_null($this->catalogData)) {
170
$data = $this->
raw
(self::FIELD_CATALOG_DATA);
171
if
(is_null($data)) {
172
return
null
;
173
}
174
$this->catalogData = (string) $data;
175
}
176
177
return
$this->catalogData
;
178
}
179
186
public
function
getVariant
()
187
{
188
if
(is_null($this->variant)) {
190
$data = $this->
raw
(self::FIELD_VARIANT);
191
if
(is_null($data)) {
192
return
null
;
193
}
194
$this->variant = (string) $data;
195
}
196
197
return
$this->variant
;
198
}
199
200
204
public
function
setChange
(?
string
$change
): void
205
{
206
$this->change =
$change
;
207
}
208
212
public
function
setPreviousValue
(?
PriceCollection
$previousValue
): void
213
{
214
$this->previousValue =
$previousValue
;
215
}
216
220
public
function
setNextValue
(?
PriceCollection
$nextValue
): void
221
{
222
$this->nextValue =
$nextValue
;
223
}
224
228
public
function
setCatalogData
(?
string
$catalogData
): void
229
{
230
$this->catalogData =
$catalogData
;
231
}
232
236
public
function
setVariant
(?
string
$variant
): void
237
{
238
$this->variant =
$variant
;
239
}
240
241
242
243
}
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:220
Commercetools\History\Models\Change\SetPricesChangeModel\$nextValue
$nextValue
Definition
SetPricesChangeModel.php:47
Commercetools\History\Models\Change\SetPricesChangeModel\$variant
$variant
Definition
SetPricesChangeModel.php:59
Commercetools\History\Models\Change\SetPricesChangeModel\getType
getType()
Definition
SetPricesChangeModel.php:85
Commercetools\History\Models\Change\SetPricesChangeModel\setChange
setChange(?string $change)
Definition
SetPricesChangeModel.php:204
Commercetools\History\Models\Change\SetPricesChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
SetPricesChangeModel.php:24
Commercetools\History\Models\Change\SetPricesChangeModel\getNextValue
getNextValue()
Definition
SetPricesChangeModel.php:143
Commercetools\History\Models\Change\SetPricesChangeModel\$catalogData
$catalogData
Definition
SetPricesChangeModel.php:53
Commercetools\History\Models\Change\SetPricesChangeModel\setVariant
setVariant(?string $variant)
Definition
SetPricesChangeModel.php:236
Commercetools\History\Models\Change\SetPricesChangeModel\getChange
getChange()
Definition
SetPricesChangeModel.php:103
Commercetools\History\Models\Change\SetPricesChangeModel\getPreviousValue
getPreviousValue()
Definition
SetPricesChangeModel.php:123
Commercetools\History\Models\Change\SetPricesChangeModel\$type
$type
Definition
SetPricesChangeModel.php:29
Commercetools\History\Models\Change\SetPricesChangeModel\getVariant
getVariant()
Definition
SetPricesChangeModel.php:186
Commercetools\History\Models\Change\SetPricesChangeModel\setCatalogData
setCatalogData(?string $catalogData)
Definition
SetPricesChangeModel.php:228
Commercetools\History\Models\Change\SetPricesChangeModel\setPreviousValue
setPreviousValue(?PriceCollection $previousValue)
Definition
SetPricesChangeModel.php:212
Commercetools\History\Models\Change\SetPricesChangeModel\__construct
__construct(?string $change=null, ?PriceCollection $previousValue=null, ?PriceCollection $nextValue=null, ?string $catalogData=null, ?string $variant=null, ?string $type=null)
Definition
SetPricesChangeModel.php:65
Commercetools\History\Models\Change\SetPricesChangeModel\$previousValue
$previousValue
Definition
SetPricesChangeModel.php:41
Commercetools\History\Models\Change\SetPricesChangeModel\getCatalogData
getCatalogData()
Definition
SetPricesChangeModel.php:166
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