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
SetLineItemPriceChangeModel.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\LocalizedString
;
17
use
Commercetools\History\Models\Common\LocalizedStringModel
;
18
use
Commercetools\History\Models\Common\Price
;
19
use
Commercetools\History\Models\Common\PriceModel
;
20
24
final
class
SetLineItemPriceChangeModel
extends
JsonObjectModel
implements
SetLineItemPriceChange
25
{
26
27
public
const
DISCRIMINATOR_VALUE
=
'SetLineItemPriceChange'
;
32
protected
$type
;
33
38
protected
$change
;
39
44
protected
$previousValue
;
45
50
protected
$nextValue
;
51
56
protected
$lineItem
;
57
62
protected
$lineItemId
;
63
64
68
public
function
__construct
(
69
?
string
$change
=
null
,
70
?
Price
$previousValue
=
null
,
71
?
Price
$nextValue
=
null
,
72
?
LocalizedString
$lineItem
=
null
,
73
?
string
$lineItemId
=
null
,
74
?
string
$type
=
null
75
) {
76
$this->change =
$change
;
77
$this->previousValue =
$previousValue
;
78
$this->nextValue =
$nextValue
;
79
$this->lineItem =
$lineItem
;
80
$this->lineItemId =
$lineItemId
;
81
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
82
}
83
88
public
function
getType
()
89
{
90
if
(is_null($this->type)) {
92
$data = $this->
raw
(self::FIELD_TYPE);
93
if
(is_null($data)) {
94
return
null
;
95
}
96
$this->type = (string) $data;
97
}
98
99
return
$this->type
;
100
}
101
106
public
function
getChange
()
107
{
108
if
(is_null($this->change)) {
110
$data = $this->
raw
(self::FIELD_CHANGE);
111
if
(is_null($data)) {
112
return
null
;
113
}
114
$this->change = (string) $data;
115
}
116
117
return
$this->change
;
118
}
119
126
public
function
getPreviousValue
()
127
{
128
if
(is_null($this->previousValue)) {
130
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
131
if
(is_null($data)) {
132
return
null
;
133
}
134
135
$this->previousValue = PriceModel::of($data);
136
}
137
138
return
$this->previousValue
;
139
}
140
147
public
function
getNextValue
()
148
{
149
if
(is_null($this->nextValue)) {
151
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
152
if
(is_null($data)) {
153
return
null
;
154
}
155
156
$this->nextValue = PriceModel::of($data);
157
}
158
159
return
$this->nextValue
;
160
}
161
168
public
function
getLineItem
()
169
{
170
if
(is_null($this->lineItem)) {
172
$data = $this->
raw
(self::FIELD_LINE_ITEM);
173
if
(is_null($data)) {
174
return
null
;
175
}
176
177
$this->lineItem = LocalizedStringModel::of($data);
178
}
179
180
return
$this->lineItem
;
181
}
182
189
public
function
getLineItemId
()
190
{
191
if
(is_null($this->lineItemId)) {
193
$data = $this->
raw
(self::FIELD_LINE_ITEM_ID);
194
if
(is_null($data)) {
195
return
null
;
196
}
197
$this->lineItemId = (string) $data;
198
}
199
200
return
$this->lineItemId
;
201
}
202
203
207
public
function
setChange
(?
string
$change
): void
208
{
209
$this->change =
$change
;
210
}
211
215
public
function
setPreviousValue
(?
Price
$previousValue
): void
216
{
217
$this->previousValue =
$previousValue
;
218
}
219
223
public
function
setNextValue
(?
Price
$nextValue
): void
224
{
225
$this->nextValue =
$nextValue
;
226
}
227
231
public
function
setLineItem
(?
LocalizedString
$lineItem
): void
232
{
233
$this->lineItem =
$lineItem
;
234
}
235
239
public
function
setLineItemId
(?
string
$lineItemId
): void
240
{
241
$this->lineItemId =
$lineItemId
;
242
}
243
244
245
246
}
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\SetLineItemPriceChangeModel
Definition
SetLineItemPriceChangeModel.php:25
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\getLineItem
getLineItem()
Definition
SetLineItemPriceChangeModel.php:168
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\$nextValue
$nextValue
Definition
SetLineItemPriceChangeModel.php:50
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\setNextValue
setNextValue(?Price $nextValue)
Definition
SetLineItemPriceChangeModel.php:223
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\__construct
__construct(?string $change=null, ?Price $previousValue=null, ?Price $nextValue=null, ?LocalizedString $lineItem=null, ?string $lineItemId=null, ?string $type=null)
Definition
SetLineItemPriceChangeModel.php:68
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\getChange
getChange()
Definition
SetLineItemPriceChangeModel.php:106
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\$previousValue
$previousValue
Definition
SetLineItemPriceChangeModel.php:44
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\setLineItemId
setLineItemId(?string $lineItemId)
Definition
SetLineItemPriceChangeModel.php:239
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\$lineItem
$lineItem
Definition
SetLineItemPriceChangeModel.php:56
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\$lineItemId
$lineItemId
Definition
SetLineItemPriceChangeModel.php:62
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\$change
$change
Definition
SetLineItemPriceChangeModel.php:38
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\$type
$type
Definition
SetLineItemPriceChangeModel.php:32
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\getLineItemId
getLineItemId()
Definition
SetLineItemPriceChangeModel.php:189
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\setLineItem
setLineItem(?LocalizedString $lineItem)
Definition
SetLineItemPriceChangeModel.php:231
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\setChange
setChange(?string $change)
Definition
SetLineItemPriceChangeModel.php:207
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\getType
getType()
Definition
SetLineItemPriceChangeModel.php:88
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
SetLineItemPriceChangeModel.php:27
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\setPreviousValue
setPreviousValue(?Price $previousValue)
Definition
SetLineItemPriceChangeModel.php:215
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\getPreviousValue
getPreviousValue()
Definition
SetLineItemPriceChangeModel.php:126
Commercetools\History\Models\Change\SetLineItemPriceChangeModel\getNextValue
getNextValue()
Definition
SetLineItemPriceChangeModel.php:147
Commercetools\History\Models\Common\LocalizedStringModel
Definition
LocalizedStringModel.php:17
Commercetools\History\Models\Common\PriceModel
Definition
PriceModel.php:22
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\SetLineItemPriceChange
Definition
SetLineItemPriceChange.php:17
Commercetools\History\Models\Common\LocalizedString
Definition
LocalizedString.php:14
Commercetools\History\Models\Common\Price
Definition
Price.php:16
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8