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\Price
;
17
use
Commercetools\History\Models\Common\PriceModel
;
18
22
final
class
SetDiscountedPriceChangeModel
extends
JsonObjectModel
implements
SetDiscountedPriceChange
23
{
24
25
public
const
DISCRIMINATOR_VALUE
=
'SetDiscountedPriceChange'
;
30
protected
$type
;
31
36
protected
$change
;
37
42
protected
$previousValue
;
43
48
protected
$nextValue
;
49
54
protected
$catalogData
;
55
60
protected
$variant
;
61
66
protected
$priceId
;
67
68
72
public
function
__construct
(
73
?
string
$change
=
null
,
74
?
Price
$previousValue
=
null
,
75
?
Price
$nextValue
=
null
,
76
?
string
$catalogData
=
null
,
77
?
string
$variant
=
null
,
78
?
string
$priceId
=
null
,
79
?
string
$type
=
null
80
) {
81
$this->change =
$change
;
82
$this->previousValue =
$previousValue
;
83
$this->nextValue =
$nextValue
;
84
$this->catalogData =
$catalogData
;
85
$this->variant =
$variant
;
86
$this->priceId =
$priceId
;
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
177
public
function
getCatalogData
()
178
{
179
if
(is_null($this->catalogData)) {
181
$data = $this->
raw
(self::FIELD_CATALOG_DATA);
182
if
(is_null($data)) {
183
return
null
;
184
}
185
$this->catalogData = (string) $data;
186
}
187
188
return
$this->catalogData
;
189
}
190
197
public
function
getVariant
()
198
{
199
if
(is_null($this->variant)) {
201
$data = $this->
raw
(self::FIELD_VARIANT);
202
if
(is_null($data)) {
203
return
null
;
204
}
205
$this->variant = (string) $data;
206
}
207
208
return
$this->variant
;
209
}
210
217
public
function
getPriceId
()
218
{
219
if
(is_null($this->priceId)) {
221
$data = $this->
raw
(self::FIELD_PRICE_ID);
222
if
(is_null($data)) {
223
return
null
;
224
}
225
$this->priceId = (string) $data;
226
}
227
228
return
$this->priceId
;
229
}
230
231
235
public
function
setChange
(?
string
$change
): void
236
{
237
$this->change =
$change
;
238
}
239
243
public
function
setPreviousValue
(?
Price
$previousValue
): void
244
{
245
$this->previousValue =
$previousValue
;
246
}
247
251
public
function
setNextValue
(?
Price
$nextValue
): void
252
{
253
$this->nextValue =
$nextValue
;
254
}
255
259
public
function
setCatalogData
(?
string
$catalogData
): void
260
{
261
$this->catalogData =
$catalogData
;
262
}
263
267
public
function
setVariant
(?
string
$variant
): void
268
{
269
$this->variant =
$variant
;
270
}
271
275
public
function
setPriceId
(?
string
$priceId
): void
276
{
277
$this->priceId =
$priceId
;
278
}
279
280
281
282
}
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:23
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\$nextValue
$nextValue
Definition
SetDiscountedPriceChangeModel.php:48
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\__construct
__construct(?string $change=null, ?Price $previousValue=null, ?Price $nextValue=null, ?string $catalogData=null, ?string $variant=null, ?string $priceId=null, ?string $type=null)
Definition
SetDiscountedPriceChangeModel.php:72
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\setPriceId
setPriceId(?string $priceId)
Definition
SetDiscountedPriceChangeModel.php:275
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\$catalogData
$catalogData
Definition
SetDiscountedPriceChangeModel.php:54
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\getVariant
getVariant()
Definition
SetDiscountedPriceChangeModel.php:197
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\getCatalogData
getCatalogData()
Definition
SetDiscountedPriceChangeModel.php:177
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\$type
$type
Definition
SetDiscountedPriceChangeModel.php:30
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\getPriceId
getPriceId()
Definition
SetDiscountedPriceChangeModel.php:217
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\$change
$change
Definition
SetDiscountedPriceChangeModel.php:36
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
SetDiscountedPriceChangeModel.php:25
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\getNextValue
getNextValue()
Definition
SetDiscountedPriceChangeModel.php:153
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\$priceId
$priceId
Definition
SetDiscountedPriceChangeModel.php:66
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\setNextValue
setNextValue(?Price $nextValue)
Definition
SetDiscountedPriceChangeModel.php:251
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\setChange
setChange(?string $change)
Definition
SetDiscountedPriceChangeModel.php:235
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\getPreviousValue
getPreviousValue()
Definition
SetDiscountedPriceChangeModel.php:132
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\$previousValue
$previousValue
Definition
SetDiscountedPriceChangeModel.php:42
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\setPreviousValue
setPreviousValue(?Price $previousValue)
Definition
SetDiscountedPriceChangeModel.php:243
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\$variant
$variant
Definition
SetDiscountedPriceChangeModel.php:60
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\setVariant
setVariant(?string $variant)
Definition
SetDiscountedPriceChangeModel.php:267
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\getType
getType()
Definition
SetDiscountedPriceChangeModel.php:94
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\setCatalogData
setCatalogData(?string $catalogData)
Definition
SetDiscountedPriceChangeModel.php:259
Commercetools\History\Models\Change\SetDiscountedPriceChangeModel\getChange
getChange()
Definition
SetDiscountedPriceChangeModel.php:112
Commercetools\History\Models\Common\PriceModel
Definition
PriceModel.php:21
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\SetDiscountedPriceChange
Definition
SetDiscountedPriceChange.php:16
Commercetools\History\Models\Common\Price
Definition
Price.php:15
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8