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
ChangeLineItemQuantityChangeModel.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
22
final
class
ChangeLineItemQuantityChangeModel
extends
JsonObjectModel
implements
ChangeLineItemQuantityChange
23
{
24
25
public
const
DISCRIMINATOR_VALUE
=
'ChangeLineItemQuantityChange'
;
30
protected
$type
;
31
36
protected
$change
;
37
42
protected
$previousValue
;
43
48
protected
$nextValue
;
49
54
protected
$lineItem
;
55
60
protected
$lineItemId
;
61
62
66
public
function
__construct
(
67
?
string
$change
=
null
,
68
?
int
$previousValue
=
null
,
69
?
int
$nextValue
=
null
,
70
?
LocalizedString
$lineItem
=
null
,
71
?
string
$lineItemId
=
null
,
72
?
string
$type
=
null
73
) {
74
$this->change =
$change
;
75
$this->previousValue =
$previousValue
;
76
$this->nextValue =
$nextValue
;
77
$this->lineItem =
$lineItem
;
78
$this->lineItemId =
$lineItemId
;
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
getPreviousValue
()
125
{
126
if
(is_null($this->previousValue)) {
128
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
129
if
(is_null($data)) {
130
return
null
;
131
}
132
$this->previousValue = (int) $data;
133
}
134
135
return
$this->previousValue
;
136
}
137
144
public
function
getNextValue
()
145
{
146
if
(is_null($this->nextValue)) {
148
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
149
if
(is_null($data)) {
150
return
null
;
151
}
152
$this->nextValue = (int) $data;
153
}
154
155
return
$this->nextValue
;
156
}
157
164
public
function
getLineItem
()
165
{
166
if
(is_null($this->lineItem)) {
168
$data = $this->
raw
(self::FIELD_LINE_ITEM);
169
if
(is_null($data)) {
170
return
null
;
171
}
172
173
$this->lineItem = LocalizedStringModel::of($data);
174
}
175
176
return
$this->lineItem
;
177
}
178
185
public
function
getLineItemId
()
186
{
187
if
(is_null($this->lineItemId)) {
189
$data = $this->
raw
(self::FIELD_LINE_ITEM_ID);
190
if
(is_null($data)) {
191
return
null
;
192
}
193
$this->lineItemId = (string) $data;
194
}
195
196
return
$this->lineItemId
;
197
}
198
199
203
public
function
setChange
(?
string
$change
): void
204
{
205
$this->change =
$change
;
206
}
207
211
public
function
setPreviousValue
(?
int
$previousValue
): void
212
{
213
$this->previousValue =
$previousValue
;
214
}
215
219
public
function
setNextValue
(?
int
$nextValue
): void
220
{
221
$this->nextValue =
$nextValue
;
222
}
223
227
public
function
setLineItem
(?
LocalizedString
$lineItem
): void
228
{
229
$this->lineItem =
$lineItem
;
230
}
231
235
public
function
setLineItemId
(?
string
$lineItemId
): void
236
{
237
$this->lineItemId =
$lineItemId
;
238
}
239
240
241
242
}
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\ChangeLineItemQuantityChangeModel
Definition
ChangeLineItemQuantityChangeModel.php:23
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\setPreviousValue
setPreviousValue(?int $previousValue)
Definition
ChangeLineItemQuantityChangeModel.php:211
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\$lineItemId
$lineItemId
Definition
ChangeLineItemQuantityChangeModel.php:60
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
ChangeLineItemQuantityChangeModel.php:25
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\setLineItem
setLineItem(?LocalizedString $lineItem)
Definition
ChangeLineItemQuantityChangeModel.php:227
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\setNextValue
setNextValue(?int $nextValue)
Definition
ChangeLineItemQuantityChangeModel.php:219
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\setChange
setChange(?string $change)
Definition
ChangeLineItemQuantityChangeModel.php:203
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\$lineItem
$lineItem
Definition
ChangeLineItemQuantityChangeModel.php:54
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\$type
$type
Definition
ChangeLineItemQuantityChangeModel.php:30
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\getLineItemId
getLineItemId()
Definition
ChangeLineItemQuantityChangeModel.php:185
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\setLineItemId
setLineItemId(?string $lineItemId)
Definition
ChangeLineItemQuantityChangeModel.php:235
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\$nextValue
$nextValue
Definition
ChangeLineItemQuantityChangeModel.php:48
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\__construct
__construct(?string $change=null, ?int $previousValue=null, ?int $nextValue=null, ?LocalizedString $lineItem=null, ?string $lineItemId=null, ?string $type=null)
Definition
ChangeLineItemQuantityChangeModel.php:66
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\getType
getType()
Definition
ChangeLineItemQuantityChangeModel.php:86
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\getChange
getChange()
Definition
ChangeLineItemQuantityChangeModel.php:104
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\getNextValue
getNextValue()
Definition
ChangeLineItemQuantityChangeModel.php:144
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\getLineItem
getLineItem()
Definition
ChangeLineItemQuantityChangeModel.php:164
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\$previousValue
$previousValue
Definition
ChangeLineItemQuantityChangeModel.php:42
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\getPreviousValue
getPreviousValue()
Definition
ChangeLineItemQuantityChangeModel.php:124
Commercetools\History\Models\Change\ChangeLineItemQuantityChangeModel\$change
$change
Definition
ChangeLineItemQuantityChangeModel.php:36
Commercetools\History\Models\Common\LocalizedStringModel
Definition
LocalizedStringModel.php:17
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\ChangeLineItemQuantityChange
Definition
ChangeLineItemQuantityChange.php:16
Commercetools\History\Models\Common\LocalizedString
Definition
LocalizedString.php:14
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8