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
SetDeliveryItemsChangeModel.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\DeliveryItemCollection
;
17
21
final
class
SetDeliveryItemsChangeModel
extends
JsonObjectModel
implements
SetDeliveryItemsChange
22
{
23
24
public
const
DISCRIMINATOR_VALUE
=
'SetDeliveryItemsChange'
;
29
protected
$type
;
30
35
protected
$change
;
36
41
protected
$previousValue
;
42
47
protected
$nextValue
;
48
53
protected
$deliveryId
;
54
55
59
public
function
__construct
(
60
?
string
$change
=
null
,
61
?
DeliveryItemCollection
$previousValue
=
null
,
62
?
DeliveryItemCollection
$nextValue
=
null
,
63
?
string
$deliveryId
=
null
,
64
?
string
$type
=
null
65
) {
66
$this->change =
$change
;
67
$this->previousValue =
$previousValue
;
68
$this->nextValue =
$nextValue
;
69
$this->deliveryId =
$deliveryId
;
70
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
71
}
72
77
public
function
getType
()
78
{
79
if
(is_null($this->type)) {
81
$data = $this->
raw
(self::FIELD_TYPE);
82
if
(is_null($data)) {
83
return
null
;
84
}
85
$this->type = (string) $data;
86
}
87
88
return
$this->type
;
89
}
90
95
public
function
getChange
()
96
{
97
if
(is_null($this->change)) {
99
$data = $this->
raw
(self::FIELD_CHANGE);
100
if
(is_null($data)) {
101
return
null
;
102
}
103
$this->change = (string) $data;
104
}
105
106
return
$this->change
;
107
}
108
115
public
function
getPreviousValue
()
116
{
117
if
(is_null($this->previousValue)) {
119
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
120
if
(is_null($data)) {
121
return
null
;
122
}
123
$this->previousValue = DeliveryItemCollection::fromArray($data);
124
}
125
126
return
$this->previousValue
;
127
}
128
135
public
function
getNextValue
()
136
{
137
if
(is_null($this->nextValue)) {
139
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
140
if
(is_null($data)) {
141
return
null
;
142
}
143
$this->nextValue = DeliveryItemCollection::fromArray($data);
144
}
145
146
return
$this->nextValue
;
147
}
148
155
public
function
getDeliveryId
()
156
{
157
if
(is_null($this->deliveryId)) {
159
$data = $this->
raw
(self::FIELD_DELIVERY_ID);
160
if
(is_null($data)) {
161
return
null
;
162
}
163
$this->deliveryId = (string) $data;
164
}
165
166
return
$this->deliveryId
;
167
}
168
169
173
public
function
setChange
(?
string
$change
): void
174
{
175
$this->change =
$change
;
176
}
177
181
public
function
setPreviousValue
(?
DeliveryItemCollection
$previousValue
): void
182
{
183
$this->previousValue =
$previousValue
;
184
}
185
189
public
function
setNextValue
(?
DeliveryItemCollection
$nextValue
): void
190
{
191
$this->nextValue =
$nextValue
;
192
}
193
197
public
function
setDeliveryId
(?
string
$deliveryId
): void
198
{
199
$this->deliveryId =
$deliveryId
;
200
}
201
202
203
204
}
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\SetDeliveryItemsChangeModel
Definition
SetDeliveryItemsChangeModel.php:22
Commercetools\History\Models\Change\SetDeliveryItemsChangeModel\getPreviousValue
getPreviousValue()
Definition
SetDeliveryItemsChangeModel.php:115
Commercetools\History\Models\Change\SetDeliveryItemsChangeModel\$change
$change
Definition
SetDeliveryItemsChangeModel.php:35
Commercetools\History\Models\Change\SetDeliveryItemsChangeModel\setDeliveryId
setDeliveryId(?string $deliveryId)
Definition
SetDeliveryItemsChangeModel.php:197
Commercetools\History\Models\Change\SetDeliveryItemsChangeModel\$type
$type
Definition
SetDeliveryItemsChangeModel.php:29
Commercetools\History\Models\Change\SetDeliveryItemsChangeModel\setChange
setChange(?string $change)
Definition
SetDeliveryItemsChangeModel.php:173
Commercetools\History\Models\Change\SetDeliveryItemsChangeModel\getNextValue
getNextValue()
Definition
SetDeliveryItemsChangeModel.php:135
Commercetools\History\Models\Change\SetDeliveryItemsChangeModel\setPreviousValue
setPreviousValue(?DeliveryItemCollection $previousValue)
Definition
SetDeliveryItemsChangeModel.php:181
Commercetools\History\Models\Change\SetDeliveryItemsChangeModel\$previousValue
$previousValue
Definition
SetDeliveryItemsChangeModel.php:41
Commercetools\History\Models\Change\SetDeliveryItemsChangeModel\getType
getType()
Definition
SetDeliveryItemsChangeModel.php:77
Commercetools\History\Models\Change\SetDeliveryItemsChangeModel\__construct
__construct(?string $change=null, ?DeliveryItemCollection $previousValue=null, ?DeliveryItemCollection $nextValue=null, ?string $deliveryId=null, ?string $type=null)
Definition
SetDeliveryItemsChangeModel.php:59
Commercetools\History\Models\Change\SetDeliveryItemsChangeModel\$deliveryId
$deliveryId
Definition
SetDeliveryItemsChangeModel.php:53
Commercetools\History\Models\Change\SetDeliveryItemsChangeModel\setNextValue
setNextValue(?DeliveryItemCollection $nextValue)
Definition
SetDeliveryItemsChangeModel.php:189
Commercetools\History\Models\Change\SetDeliveryItemsChangeModel\getChange
getChange()
Definition
SetDeliveryItemsChangeModel.php:95
Commercetools\History\Models\Change\SetDeliveryItemsChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
SetDeliveryItemsChangeModel.php:24
Commercetools\History\Models\Change\SetDeliveryItemsChangeModel\$nextValue
$nextValue
Definition
SetDeliveryItemsChangeModel.php:47
Commercetools\History\Models\Change\SetDeliveryItemsChangeModel\getDeliveryId
getDeliveryId()
Definition
SetDeliveryItemsChangeModel.php:155
Commercetools\History\Models\Common\DeliveryItemCollection
Definition
DeliveryItemCollection.php:22
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\SetDeliveryItemsChange
Definition
SetDeliveryItemsChange.php:16
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8