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
SetDeliveryAddressChangeModel.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\Address
;
17
use
Commercetools\History\Models\Common\AddressModel
;
18
22
final
class
SetDeliveryAddressChangeModel
extends
JsonObjectModel
implements
SetDeliveryAddressChange
23
{
24
25
public
const
DISCRIMINATOR_VALUE
=
'SetDeliveryAddressChange'
;
30
protected
$type
;
31
36
protected
$change
;
37
42
protected
$previousValue
;
43
48
protected
$nextValue
;
49
54
protected
$deliveryId
;
55
56
60
public
function
__construct
(
61
?
string
$change
=
null
,
62
?
Address
$previousValue
=
null
,
63
?
Address
$nextValue
=
null
,
64
?
string
$deliveryId
=
null
,
65
?
string
$type
=
null
66
) {
67
$this->change =
$change
;
68
$this->previousValue =
$previousValue
;
69
$this->nextValue =
$nextValue
;
70
$this->deliveryId =
$deliveryId
;
71
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
72
}
73
78
public
function
getType
()
79
{
80
if
(is_null($this->type)) {
82
$data = $this->
raw
(self::FIELD_TYPE);
83
if
(is_null($data)) {
84
return
null
;
85
}
86
$this->type = (string) $data;
87
}
88
89
return
$this->type
;
90
}
91
96
public
function
getChange
()
97
{
98
if
(is_null($this->change)) {
100
$data = $this->
raw
(self::FIELD_CHANGE);
101
if
(is_null($data)) {
102
return
null
;
103
}
104
$this->change = (string) $data;
105
}
106
107
return
$this->change
;
108
}
109
116
public
function
getPreviousValue
()
117
{
118
if
(is_null($this->previousValue)) {
120
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
121
if
(is_null($data)) {
122
return
null
;
123
}
124
125
$this->previousValue = AddressModel::of($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
146
$this->nextValue = AddressModel::of($data);
147
}
148
149
return
$this->nextValue
;
150
}
151
158
public
function
getDeliveryId
()
159
{
160
if
(is_null($this->deliveryId)) {
162
$data = $this->
raw
(self::FIELD_DELIVERY_ID);
163
if
(is_null($data)) {
164
return
null
;
165
}
166
$this->deliveryId = (string) $data;
167
}
168
169
return
$this->deliveryId
;
170
}
171
172
176
public
function
setChange
(?
string
$change
): void
177
{
178
$this->change =
$change
;
179
}
180
184
public
function
setPreviousValue
(?
Address
$previousValue
): void
185
{
186
$this->previousValue =
$previousValue
;
187
}
188
192
public
function
setNextValue
(?
Address
$nextValue
): void
193
{
194
$this->nextValue =
$nextValue
;
195
}
196
200
public
function
setDeliveryId
(?
string
$deliveryId
): void
201
{
202
$this->deliveryId =
$deliveryId
;
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\SetDeliveryAddressChangeModel
Definition
SetDeliveryAddressChangeModel.php:23
Commercetools\History\Models\Change\SetDeliveryAddressChangeModel\$previousValue
$previousValue
Definition
SetDeliveryAddressChangeModel.php:42
Commercetools\History\Models\Change\SetDeliveryAddressChangeModel\$type
$type
Definition
SetDeliveryAddressChangeModel.php:30
Commercetools\History\Models\Change\SetDeliveryAddressChangeModel\$nextValue
$nextValue
Definition
SetDeliveryAddressChangeModel.php:48
Commercetools\History\Models\Change\SetDeliveryAddressChangeModel\getPreviousValue
getPreviousValue()
Definition
SetDeliveryAddressChangeModel.php:116
Commercetools\History\Models\Change\SetDeliveryAddressChangeModel\setChange
setChange(?string $change)
Definition
SetDeliveryAddressChangeModel.php:176
Commercetools\History\Models\Change\SetDeliveryAddressChangeModel\getDeliveryId
getDeliveryId()
Definition
SetDeliveryAddressChangeModel.php:158
Commercetools\History\Models\Change\SetDeliveryAddressChangeModel\getChange
getChange()
Definition
SetDeliveryAddressChangeModel.php:96
Commercetools\History\Models\Change\SetDeliveryAddressChangeModel\setDeliveryId
setDeliveryId(?string $deliveryId)
Definition
SetDeliveryAddressChangeModel.php:200
Commercetools\History\Models\Change\SetDeliveryAddressChangeModel\getNextValue
getNextValue()
Definition
SetDeliveryAddressChangeModel.php:137
Commercetools\History\Models\Change\SetDeliveryAddressChangeModel\__construct
__construct(?string $change=null, ?Address $previousValue=null, ?Address $nextValue=null, ?string $deliveryId=null, ?string $type=null)
Definition
SetDeliveryAddressChangeModel.php:60
Commercetools\History\Models\Change\SetDeliveryAddressChangeModel\$change
$change
Definition
SetDeliveryAddressChangeModel.php:36
Commercetools\History\Models\Change\SetDeliveryAddressChangeModel\setNextValue
setNextValue(?Address $nextValue)
Definition
SetDeliveryAddressChangeModel.php:192
Commercetools\History\Models\Change\SetDeliveryAddressChangeModel\getType
getType()
Definition
SetDeliveryAddressChangeModel.php:78
Commercetools\History\Models\Change\SetDeliveryAddressChangeModel\$deliveryId
$deliveryId
Definition
SetDeliveryAddressChangeModel.php:54
Commercetools\History\Models\Change\SetDeliveryAddressChangeModel\setPreviousValue
setPreviousValue(?Address $previousValue)
Definition
SetDeliveryAddressChangeModel.php:184
Commercetools\History\Models\Change\SetDeliveryAddressChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
SetDeliveryAddressChangeModel.php:25
Commercetools\History\Models\Common\AddressModel
Definition
AddressModel.php:21
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\SetDeliveryAddressChange
Definition
SetDeliveryAddressChange.php:16
Commercetools\History\Models\Common\Address
Definition
Address.php:15
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8