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
SetParcelItemsChangeModel.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\ChangeValue\ParcelChangeValue
;
17
use
Commercetools\History\Models\ChangeValue\ParcelChangeValueModel
;
18
use
Commercetools\History\Models\Common\DeliveryItemCollection
;
19
23
final
class
SetParcelItemsChangeModel
extends
JsonObjectModel
implements
SetParcelItemsChange
24
{
25
26
public
const
DISCRIMINATOR_VALUE
=
'SetParcelItemsChange'
;
31
protected
$type
;
32
37
protected
$change
;
38
43
protected
$previousValue
;
44
49
protected
$nextValue
;
50
55
protected
$parcel
;
56
57
61
public
function
__construct
(
62
?
string
$change
=
null
,
63
?
DeliveryItemCollection
$previousValue
=
null
,
64
?
DeliveryItemCollection
$nextValue
=
null
,
65
?
ParcelChangeValue
$parcel
=
null
,
66
?
string
$type
=
null
67
) {
68
$this->change =
$change
;
69
$this->previousValue =
$previousValue
;
70
$this->nextValue =
$nextValue
;
71
$this->parcel =
$parcel
;
72
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
73
}
74
79
public
function
getType
()
80
{
81
if
(is_null($this->type)) {
83
$data = $this->
raw
(self::FIELD_TYPE);
84
if
(is_null($data)) {
85
return
null
;
86
}
87
$this->type = (string) $data;
88
}
89
90
return
$this->type
;
91
}
92
97
public
function
getChange
()
98
{
99
if
(is_null($this->change)) {
101
$data = $this->
raw
(self::FIELD_CHANGE);
102
if
(is_null($data)) {
103
return
null
;
104
}
105
$this->change = (string) $data;
106
}
107
108
return
$this->change
;
109
}
110
117
public
function
getPreviousValue
()
118
{
119
if
(is_null($this->previousValue)) {
121
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
122
if
(is_null($data)) {
123
return
null
;
124
}
125
$this->previousValue = DeliveryItemCollection::fromArray($data);
126
}
127
128
return
$this->previousValue
;
129
}
130
137
public
function
getNextValue
()
138
{
139
if
(is_null($this->nextValue)) {
141
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
142
if
(is_null($data)) {
143
return
null
;
144
}
145
$this->nextValue = DeliveryItemCollection::fromArray($data);
146
}
147
148
return
$this->nextValue
;
149
}
150
157
public
function
getParcel
()
158
{
159
if
(is_null($this->parcel)) {
161
$data = $this->
raw
(self::FIELD_PARCEL);
162
if
(is_null($data)) {
163
return
null
;
164
}
165
166
$this->parcel = ParcelChangeValueModel::of($data);
167
}
168
169
return
$this->parcel
;
170
}
171
172
176
public
function
setChange
(?
string
$change
): void
177
{
178
$this->change =
$change
;
179
}
180
184
public
function
setPreviousValue
(?
DeliveryItemCollection
$previousValue
): void
185
{
186
$this->previousValue =
$previousValue
;
187
}
188
192
public
function
setNextValue
(?
DeliveryItemCollection
$nextValue
): void
193
{
194
$this->nextValue =
$nextValue
;
195
}
196
200
public
function
setParcel
(?
ParcelChangeValue
$parcel
): void
201
{
202
$this->parcel =
$parcel
;
203
}
204
205
206
207
}
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\SetParcelItemsChangeModel
Definition
SetParcelItemsChangeModel.php:24
Commercetools\History\Models\Change\SetParcelItemsChangeModel\setParcel
setParcel(?ParcelChangeValue $parcel)
Definition
SetParcelItemsChangeModel.php:200
Commercetools\History\Models\Change\SetParcelItemsChangeModel\$parcel
$parcel
Definition
SetParcelItemsChangeModel.php:55
Commercetools\History\Models\Change\SetParcelItemsChangeModel\getNextValue
getNextValue()
Definition
SetParcelItemsChangeModel.php:137
Commercetools\History\Models\Change\SetParcelItemsChangeModel\getChange
getChange()
Definition
SetParcelItemsChangeModel.php:97
Commercetools\History\Models\Change\SetParcelItemsChangeModel\$previousValue
$previousValue
Definition
SetParcelItemsChangeModel.php:43
Commercetools\History\Models\Change\SetParcelItemsChangeModel\__construct
__construct(?string $change=null, ?DeliveryItemCollection $previousValue=null, ?DeliveryItemCollection $nextValue=null, ?ParcelChangeValue $parcel=null, ?string $type=null)
Definition
SetParcelItemsChangeModel.php:61
Commercetools\History\Models\Change\SetParcelItemsChangeModel\$nextValue
$nextValue
Definition
SetParcelItemsChangeModel.php:49
Commercetools\History\Models\Change\SetParcelItemsChangeModel\setChange
setChange(?string $change)
Definition
SetParcelItemsChangeModel.php:176
Commercetools\History\Models\Change\SetParcelItemsChangeModel\getType
getType()
Definition
SetParcelItemsChangeModel.php:79
Commercetools\History\Models\Change\SetParcelItemsChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
SetParcelItemsChangeModel.php:26
Commercetools\History\Models\Change\SetParcelItemsChangeModel\getParcel
getParcel()
Definition
SetParcelItemsChangeModel.php:157
Commercetools\History\Models\Change\SetParcelItemsChangeModel\setPreviousValue
setPreviousValue(?DeliveryItemCollection $previousValue)
Definition
SetParcelItemsChangeModel.php:184
Commercetools\History\Models\Change\SetParcelItemsChangeModel\getPreviousValue
getPreviousValue()
Definition
SetParcelItemsChangeModel.php:117
Commercetools\History\Models\Change\SetParcelItemsChangeModel\$type
$type
Definition
SetParcelItemsChangeModel.php:31
Commercetools\History\Models\Change\SetParcelItemsChangeModel\$change
$change
Definition
SetParcelItemsChangeModel.php:37
Commercetools\History\Models\Change\SetParcelItemsChangeModel\setNextValue
setNextValue(?DeliveryItemCollection $nextValue)
Definition
SetParcelItemsChangeModel.php:192
Commercetools\History\Models\ChangeValue\ParcelChangeValueModel
Definition
ParcelChangeValueModel.php:21
Commercetools\History\Models\Common\DeliveryItemCollection
Definition
DeliveryItemCollection.php:22
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\SetParcelItemsChange
Definition
SetParcelItemsChange.php:17
Commercetools\History\Models\ChangeValue\ParcelChangeValue
Definition
ParcelChangeValue.php:15
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8