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
TransitionLineItemStateChangeModel.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\ItemStateCollection
;
17
21
final
class
TransitionLineItemStateChangeModel
extends
JsonObjectModel
implements
TransitionLineItemStateChange
22
{
23
24
public
const
DISCRIMINATOR_VALUE
=
'TransitionLineItemStateChange'
;
29
protected
$type
;
30
35
protected
$change
;
36
41
protected
$previousValue
;
42
47
protected
$nextValue
;
48
53
protected
$lineItemId
;
54
59
protected
$stateId
;
60
61
65
public
function
__construct
(
66
?
string
$change
=
null
,
67
?
ItemStateCollection
$previousValue
=
null
,
68
?
ItemStateCollection
$nextValue
=
null
,
69
?
string
$lineItemId
=
null
,
70
?
string
$stateId
=
null
,
71
?
string
$type
=
null
72
) {
73
$this->change =
$change
;
74
$this->previousValue =
$previousValue
;
75
$this->nextValue =
$nextValue
;
76
$this->lineItemId =
$lineItemId
;
77
$this->stateId =
$stateId
;
78
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
79
}
80
85
public
function
getType
()
86
{
87
if
(is_null($this->type)) {
89
$data = $this->
raw
(self::FIELD_TYPE);
90
if
(is_null($data)) {
91
return
null
;
92
}
93
$this->type = (string) $data;
94
}
95
96
return
$this->type
;
97
}
98
103
public
function
getChange
()
104
{
105
if
(is_null($this->change)) {
107
$data = $this->
raw
(self::FIELD_CHANGE);
108
if
(is_null($data)) {
109
return
null
;
110
}
111
$this->change = (string) $data;
112
}
113
114
return
$this->change
;
115
}
116
123
public
function
getPreviousValue
()
124
{
125
if
(is_null($this->previousValue)) {
127
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
128
if
(is_null($data)) {
129
return
null
;
130
}
131
$this->previousValue = ItemStateCollection::fromArray($data);
132
}
133
134
return
$this->previousValue
;
135
}
136
143
public
function
getNextValue
()
144
{
145
if
(is_null($this->nextValue)) {
147
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
148
if
(is_null($data)) {
149
return
null
;
150
}
151
$this->nextValue = ItemStateCollection::fromArray($data);
152
}
153
154
return
$this->nextValue
;
155
}
156
163
public
function
getLineItemId
()
164
{
165
if
(is_null($this->lineItemId)) {
167
$data = $this->
raw
(self::FIELD_LINE_ITEM_ID);
168
if
(is_null($data)) {
169
return
null
;
170
}
171
$this->lineItemId = (string) $data;
172
}
173
174
return
$this->lineItemId
;
175
}
176
183
public
function
getStateId
()
184
{
185
if
(is_null($this->stateId)) {
187
$data = $this->
raw
(self::FIELD_STATE_ID);
188
if
(is_null($data)) {
189
return
null
;
190
}
191
$this->stateId = (string) $data;
192
}
193
194
return
$this->stateId
;
195
}
196
197
201
public
function
setChange
(?
string
$change
): void
202
{
203
$this->change =
$change
;
204
}
205
209
public
function
setPreviousValue
(?
ItemStateCollection
$previousValue
): void
210
{
211
$this->previousValue =
$previousValue
;
212
}
213
217
public
function
setNextValue
(?
ItemStateCollection
$nextValue
): void
218
{
219
$this->nextValue =
$nextValue
;
220
}
221
225
public
function
setLineItemId
(?
string
$lineItemId
): void
226
{
227
$this->lineItemId =
$lineItemId
;
228
}
229
233
public
function
setStateId
(?
string
$stateId
): void
234
{
235
$this->stateId =
$stateId
;
236
}
237
238
239
240
}
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\TransitionLineItemStateChangeModel
Definition
TransitionLineItemStateChangeModel.php:22
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\setPreviousValue
setPreviousValue(?ItemStateCollection $previousValue)
Definition
TransitionLineItemStateChangeModel.php:209
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\__construct
__construct(?string $change=null, ?ItemStateCollection $previousValue=null, ?ItemStateCollection $nextValue=null, ?string $lineItemId=null, ?string $stateId=null, ?string $type=null)
Definition
TransitionLineItemStateChangeModel.php:65
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\setStateId
setStateId(?string $stateId)
Definition
TransitionLineItemStateChangeModel.php:233
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\setLineItemId
setLineItemId(?string $lineItemId)
Definition
TransitionLineItemStateChangeModel.php:225
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\$change
$change
Definition
TransitionLineItemStateChangeModel.php:35
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\$stateId
$stateId
Definition
TransitionLineItemStateChangeModel.php:59
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
TransitionLineItemStateChangeModel.php:24
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\setNextValue
setNextValue(?ItemStateCollection $nextValue)
Definition
TransitionLineItemStateChangeModel.php:217
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\getPreviousValue
getPreviousValue()
Definition
TransitionLineItemStateChangeModel.php:123
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\$nextValue
$nextValue
Definition
TransitionLineItemStateChangeModel.php:47
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\getChange
getChange()
Definition
TransitionLineItemStateChangeModel.php:103
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\$type
$type
Definition
TransitionLineItemStateChangeModel.php:29
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\setChange
setChange(?string $change)
Definition
TransitionLineItemStateChangeModel.php:201
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\getNextValue
getNextValue()
Definition
TransitionLineItemStateChangeModel.php:143
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\getType
getType()
Definition
TransitionLineItemStateChangeModel.php:85
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\getLineItemId
getLineItemId()
Definition
TransitionLineItemStateChangeModel.php:163
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\$lineItemId
$lineItemId
Definition
TransitionLineItemStateChangeModel.php:53
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\getStateId
getStateId()
Definition
TransitionLineItemStateChangeModel.php:183
Commercetools\History\Models\Change\TransitionLineItemStateChangeModel\$previousValue
$previousValue
Definition
TransitionLineItemStateChangeModel.php:41
Commercetools\History\Models\Common\ItemStateCollection
Definition
ItemStateCollection.php:22
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\TransitionLineItemStateChange
Definition
TransitionLineItemStateChange.php:16
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8