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
ChangePriceChangeModel.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\Price
;
17
use
Commercetools\History\Models\Common\PriceModel
;
18
22
final
class
ChangePriceChangeModel
extends
JsonObjectModel
implements
ChangePriceChange
23
{
24
25
public
const
DISCRIMINATOR_VALUE
=
'ChangePriceChange'
;
30
protected
$type
;
31
36
protected
$change
;
37
42
protected
$previousValue
;
43
48
protected
$nextValue
;
49
54
protected
$catalogData
;
55
60
protected
$priceId
;
61
66
protected
$variant
;
67
68
72
public
function
__construct
(
73
?
string
$change
=
null
,
74
?
Price
$previousValue
=
null
,
75
?
Price
$nextValue
=
null
,
76
?
string
$catalogData
=
null
,
77
?
string
$priceId
=
null
,
78
?
string
$variant
=
null
,
79
?
string
$type
=
null
80
) {
81
$this->change =
$change
;
82
$this->previousValue =
$previousValue
;
83
$this->nextValue =
$nextValue
;
84
$this->catalogData =
$catalogData
;
85
$this->priceId =
$priceId
;
86
$this->variant =
$variant
;
87
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
88
}
89
94
public
function
getType
()
95
{
96
if
(is_null($this->type)) {
98
$data = $this->
raw
(self::FIELD_TYPE);
99
if
(is_null($data)) {
100
return
null
;
101
}
102
$this->type = (string) $data;
103
}
104
105
return
$this->type
;
106
}
107
112
public
function
getChange
()
113
{
114
if
(is_null($this->change)) {
116
$data = $this->
raw
(self::FIELD_CHANGE);
117
if
(is_null($data)) {
118
return
null
;
119
}
120
$this->change = (string) $data;
121
}
122
123
return
$this->change
;
124
}
125
132
public
function
getPreviousValue
()
133
{
134
if
(is_null($this->previousValue)) {
136
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
137
if
(is_null($data)) {
138
return
null
;
139
}
140
141
$this->previousValue = PriceModel::of($data);
142
}
143
144
return
$this->previousValue
;
145
}
146
153
public
function
getNextValue
()
154
{
155
if
(is_null($this->nextValue)) {
157
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
158
if
(is_null($data)) {
159
return
null
;
160
}
161
162
$this->nextValue = PriceModel::of($data);
163
}
164
165
return
$this->nextValue
;
166
}
167
178
public
function
getCatalogData
()
179
{
180
if
(is_null($this->catalogData)) {
182
$data = $this->
raw
(self::FIELD_CATALOG_DATA);
183
if
(is_null($data)) {
184
return
null
;
185
}
186
$this->catalogData = (string) $data;
187
}
188
189
return
$this->catalogData
;
190
}
191
198
public
function
getPriceId
()
199
{
200
if
(is_null($this->priceId)) {
202
$data = $this->
raw
(self::FIELD_PRICE_ID);
203
if
(is_null($data)) {
204
return
null
;
205
}
206
$this->priceId = (string) $data;
207
}
208
209
return
$this->priceId
;
210
}
211
219
public
function
getVariant
()
220
{
221
if
(is_null($this->variant)) {
223
$data = $this->
raw
(self::FIELD_VARIANT);
224
if
(is_null($data)) {
225
return
null
;
226
}
227
$this->variant = (string) $data;
228
}
229
230
return
$this->variant
;
231
}
232
233
237
public
function
setChange
(?
string
$change
): void
238
{
239
$this->change =
$change
;
240
}
241
245
public
function
setPreviousValue
(?
Price
$previousValue
): void
246
{
247
$this->previousValue =
$previousValue
;
248
}
249
253
public
function
setNextValue
(?
Price
$nextValue
): void
254
{
255
$this->nextValue =
$nextValue
;
256
}
257
261
public
function
setCatalogData
(?
string
$catalogData
): void
262
{
263
$this->catalogData =
$catalogData
;
264
}
265
269
public
function
setPriceId
(?
string
$priceId
): void
270
{
271
$this->priceId =
$priceId
;
272
}
273
277
public
function
setVariant
(?
string
$variant
): void
278
{
279
$this->variant =
$variant
;
280
}
281
282
283
284
}
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\ChangePriceChangeModel
Definition
ChangePriceChangeModel.php:23
Commercetools\History\Models\Change\ChangePriceChangeModel\__construct
__construct(?string $change=null, ?Price $previousValue=null, ?Price $nextValue=null, ?string $catalogData=null, ?string $priceId=null, ?string $variant=null, ?string $type=null)
Definition
ChangePriceChangeModel.php:72
Commercetools\History\Models\Change\ChangePriceChangeModel\getNextValue
getNextValue()
Definition
ChangePriceChangeModel.php:153
Commercetools\History\Models\Change\ChangePriceChangeModel\$nextValue
$nextValue
Definition
ChangePriceChangeModel.php:48
Commercetools\History\Models\Change\ChangePriceChangeModel\getCatalogData
getCatalogData()
Definition
ChangePriceChangeModel.php:178
Commercetools\History\Models\Change\ChangePriceChangeModel\setChange
setChange(?string $change)
Definition
ChangePriceChangeModel.php:237
Commercetools\History\Models\Change\ChangePriceChangeModel\setPriceId
setPriceId(?string $priceId)
Definition
ChangePriceChangeModel.php:269
Commercetools\History\Models\Change\ChangePriceChangeModel\$type
$type
Definition
ChangePriceChangeModel.php:30
Commercetools\History\Models\Change\ChangePriceChangeModel\getVariant
getVariant()
Definition
ChangePriceChangeModel.php:219
Commercetools\History\Models\Change\ChangePriceChangeModel\$change
$change
Definition
ChangePriceChangeModel.php:36
Commercetools\History\Models\Change\ChangePriceChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
ChangePriceChangeModel.php:25
Commercetools\History\Models\Change\ChangePriceChangeModel\setCatalogData
setCatalogData(?string $catalogData)
Definition
ChangePriceChangeModel.php:261
Commercetools\History\Models\Change\ChangePriceChangeModel\getChange
getChange()
Definition
ChangePriceChangeModel.php:112
Commercetools\History\Models\Change\ChangePriceChangeModel\$previousValue
$previousValue
Definition
ChangePriceChangeModel.php:42
Commercetools\History\Models\Change\ChangePriceChangeModel\getPriceId
getPriceId()
Definition
ChangePriceChangeModel.php:198
Commercetools\History\Models\Change\ChangePriceChangeModel\$catalogData
$catalogData
Definition
ChangePriceChangeModel.php:54
Commercetools\History\Models\Change\ChangePriceChangeModel\setVariant
setVariant(?string $variant)
Definition
ChangePriceChangeModel.php:277
Commercetools\History\Models\Change\ChangePriceChangeModel\setPreviousValue
setPreviousValue(?Price $previousValue)
Definition
ChangePriceChangeModel.php:245
Commercetools\History\Models\Change\ChangePriceChangeModel\$variant
$variant
Definition
ChangePriceChangeModel.php:66
Commercetools\History\Models\Change\ChangePriceChangeModel\setNextValue
setNextValue(?Price $nextValue)
Definition
ChangePriceChangeModel.php:253
Commercetools\History\Models\Change\ChangePriceChangeModel\$priceId
$priceId
Definition
ChangePriceChangeModel.php:60
Commercetools\History\Models\Change\ChangePriceChangeModel\getPreviousValue
getPreviousValue()
Definition
ChangePriceChangeModel.php:132
Commercetools\History\Models\Change\ChangePriceChangeModel\getType
getType()
Definition
ChangePriceChangeModel.php:94
Commercetools\History\Models\Common\PriceModel
Definition
PriceModel.php:22
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\ChangePriceChange
Definition
ChangePriceChange.php:16
Commercetools\History\Models\Common\Price
Definition
Price.php:16
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8