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
AddPriceChangeModel.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
AddPriceChangeModel
extends
JsonObjectModel
implements
AddPriceChange
23
{
24
25
public
const
DISCRIMINATOR_VALUE
=
'AddPriceChange'
;
30
protected
$type
;
31
36
protected
$change
;
37
42
protected
$nextValue
;
43
48
protected
$catalogData
;
49
54
protected
$priceId
;
55
60
protected
$variant
;
61
62
66
public
function
__construct
(
67
?
string
$change
=
null
,
68
?
Price
$nextValue
=
null
,
69
?
string
$catalogData
=
null
,
70
?
string
$priceId
=
null
,
71
?
string
$variant
=
null
,
72
?
string
$type
=
null
73
) {
74
$this->change =
$change
;
75
$this->nextValue =
$nextValue
;
76
$this->catalogData =
$catalogData
;
77
$this->priceId =
$priceId
;
78
$this->variant =
$variant
;
79
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
80
}
81
86
public
function
getType
()
87
{
88
if
(is_null($this->type)) {
90
$data = $this->
raw
(self::FIELD_TYPE);
91
if
(is_null($data)) {
92
return
null
;
93
}
94
$this->type = (string) $data;
95
}
96
97
return
$this->type
;
98
}
99
104
public
function
getChange
()
105
{
106
if
(is_null($this->change)) {
108
$data = $this->
raw
(self::FIELD_CHANGE);
109
if
(is_null($data)) {
110
return
null
;
111
}
112
$this->change = (string) $data;
113
}
114
115
return
$this->change
;
116
}
117
124
public
function
getNextValue
()
125
{
126
if
(is_null($this->nextValue)) {
128
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
129
if
(is_null($data)) {
130
return
null
;
131
}
132
133
$this->nextValue = PriceModel::of($data);
134
}
135
136
return
$this->nextValue
;
137
}
138
149
public
function
getCatalogData
()
150
{
151
if
(is_null($this->catalogData)) {
153
$data = $this->
raw
(self::FIELD_CATALOG_DATA);
154
if
(is_null($data)) {
155
return
null
;
156
}
157
$this->catalogData = (string) $data;
158
}
159
160
return
$this->catalogData
;
161
}
162
169
public
function
getPriceId
()
170
{
171
if
(is_null($this->priceId)) {
173
$data = $this->
raw
(self::FIELD_PRICE_ID);
174
if
(is_null($data)) {
175
return
null
;
176
}
177
$this->priceId = (string) $data;
178
}
179
180
return
$this->priceId
;
181
}
182
190
public
function
getVariant
()
191
{
192
if
(is_null($this->variant)) {
194
$data = $this->
raw
(self::FIELD_VARIANT);
195
if
(is_null($data)) {
196
return
null
;
197
}
198
$this->variant = (string) $data;
199
}
200
201
return
$this->variant
;
202
}
203
204
208
public
function
setChange
(?
string
$change
): void
209
{
210
$this->change =
$change
;
211
}
212
216
public
function
setNextValue
(?
Price
$nextValue
): void
217
{
218
$this->nextValue =
$nextValue
;
219
}
220
224
public
function
setCatalogData
(?
string
$catalogData
): void
225
{
226
$this->catalogData =
$catalogData
;
227
}
228
232
public
function
setPriceId
(?
string
$priceId
): void
233
{
234
$this->priceId =
$priceId
;
235
}
236
240
public
function
setVariant
(?
string
$variant
): void
241
{
242
$this->variant =
$variant
;
243
}
244
245
246
247
}
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\AddPriceChangeModel
Definition
AddPriceChangeModel.php:23
Commercetools\History\Models\Change\AddPriceChangeModel\getVariant
getVariant()
Definition
AddPriceChangeModel.php:190
Commercetools\History\Models\Change\AddPriceChangeModel\setChange
setChange(?string $change)
Definition
AddPriceChangeModel.php:208
Commercetools\History\Models\Change\AddPriceChangeModel\$priceId
$priceId
Definition
AddPriceChangeModel.php:54
Commercetools\History\Models\Change\AddPriceChangeModel\setVariant
setVariant(?string $variant)
Definition
AddPriceChangeModel.php:240
Commercetools\History\Models\Change\AddPriceChangeModel\getCatalogData
getCatalogData()
Definition
AddPriceChangeModel.php:149
Commercetools\History\Models\Change\AddPriceChangeModel\getPriceId
getPriceId()
Definition
AddPriceChangeModel.php:169
Commercetools\History\Models\Change\AddPriceChangeModel\__construct
__construct(?string $change=null, ?Price $nextValue=null, ?string $catalogData=null, ?string $priceId=null, ?string $variant=null, ?string $type=null)
Definition
AddPriceChangeModel.php:66
Commercetools\History\Models\Change\AddPriceChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
AddPriceChangeModel.php:25
Commercetools\History\Models\Change\AddPriceChangeModel\setNextValue
setNextValue(?Price $nextValue)
Definition
AddPriceChangeModel.php:216
Commercetools\History\Models\Change\AddPriceChangeModel\$nextValue
$nextValue
Definition
AddPriceChangeModel.php:42
Commercetools\History\Models\Change\AddPriceChangeModel\$variant
$variant
Definition
AddPriceChangeModel.php:60
Commercetools\History\Models\Change\AddPriceChangeModel\$catalogData
$catalogData
Definition
AddPriceChangeModel.php:48
Commercetools\History\Models\Change\AddPriceChangeModel\setCatalogData
setCatalogData(?string $catalogData)
Definition
AddPriceChangeModel.php:224
Commercetools\History\Models\Change\AddPriceChangeModel\$change
$change
Definition
AddPriceChangeModel.php:36
Commercetools\History\Models\Change\AddPriceChangeModel\getType
getType()
Definition
AddPriceChangeModel.php:86
Commercetools\History\Models\Change\AddPriceChangeModel\getChange
getChange()
Definition
AddPriceChangeModel.php:104
Commercetools\History\Models\Change\AddPriceChangeModel\setPriceId
setPriceId(?string $priceId)
Definition
AddPriceChangeModel.php:232
Commercetools\History\Models\Change\AddPriceChangeModel\getNextValue
getNextValue()
Definition
AddPriceChangeModel.php:124
Commercetools\History\Models\Change\AddPriceChangeModel\$type
$type
Definition
AddPriceChangeModel.php:30
Commercetools\History\Models\Common\PriceModel
Definition
PriceModel.php:22
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\AddPriceChange
Definition
AddPriceChange.php:16
Commercetools\History\Models\Common\Price
Definition
Price.php:16
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8