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
AddShippingAddressIdChangeModel.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
AddShippingAddressIdChangeModel
extends
JsonObjectModel
implements
AddShippingAddressIdChange
23
{
24
25
public
const
DISCRIMINATOR_VALUE
=
'AddShippingAddressIdChange'
;
30
protected
$type
;
31
36
protected
$change
;
37
42
protected
$previousValue
;
43
48
protected
$nextValue
;
49
54
protected
$address
;
55
56
60
public
function
__construct
(
61
?
string
$change
=
null
,
62
?array
$previousValue
=
null
,
63
?array
$nextValue
=
null
,
64
?
Address
$address
=
null
,
65
?
string
$type
=
null
66
) {
67
$this->change =
$change
;
68
$this->previousValue =
$previousValue
;
69
$this->nextValue =
$nextValue
;
70
$this->address =
$address
;
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
$this->previousValue = $data;
125
}
126
127
return
$this->previousValue
;
128
}
129
136
public
function
getNextValue
()
137
{
138
if
(is_null($this->nextValue)) {
140
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
141
if
(is_null($data)) {
142
return
null
;
143
}
144
$this->nextValue = $data;
145
}
146
147
return
$this->nextValue
;
148
}
149
156
public
function
getAddress
()
157
{
158
if
(is_null($this->address)) {
160
$data = $this->
raw
(self::FIELD_ADDRESS);
161
if
(is_null($data)) {
162
return
null
;
163
}
164
165
$this->address = AddressModel::of($data);
166
}
167
168
return
$this->address
;
169
}
170
171
175
public
function
setChange
(?
string
$change
): void
176
{
177
$this->change =
$change
;
178
}
179
183
public
function
setPreviousValue
(?array
$previousValue
): void
184
{
185
$this->previousValue =
$previousValue
;
186
}
187
191
public
function
setNextValue
(?array
$nextValue
): void
192
{
193
$this->nextValue =
$nextValue
;
194
}
195
199
public
function
setAddress
(?
Address
$address
): void
200
{
201
$this->address =
$address
;
202
}
203
204
205
206
}
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\AddShippingAddressIdChangeModel
Definition
AddShippingAddressIdChangeModel.php:23
Commercetools\History\Models\Change\AddShippingAddressIdChangeModel\__construct
__construct(?string $change=null, ?array $previousValue=null, ?array $nextValue=null, ?Address $address=null, ?string $type=null)
Definition
AddShippingAddressIdChangeModel.php:60
Commercetools\History\Models\Change\AddShippingAddressIdChangeModel\setNextValue
setNextValue(?array $nextValue)
Definition
AddShippingAddressIdChangeModel.php:191
Commercetools\History\Models\Change\AddShippingAddressIdChangeModel\$change
$change
Definition
AddShippingAddressIdChangeModel.php:36
Commercetools\History\Models\Change\AddShippingAddressIdChangeModel\getChange
getChange()
Definition
AddShippingAddressIdChangeModel.php:96
Commercetools\History\Models\Change\AddShippingAddressIdChangeModel\$nextValue
$nextValue
Definition
AddShippingAddressIdChangeModel.php:48
Commercetools\History\Models\Change\AddShippingAddressIdChangeModel\getPreviousValue
getPreviousValue()
Definition
AddShippingAddressIdChangeModel.php:116
Commercetools\History\Models\Change\AddShippingAddressIdChangeModel\$address
$address
Definition
AddShippingAddressIdChangeModel.php:54
Commercetools\History\Models\Change\AddShippingAddressIdChangeModel\getNextValue
getNextValue()
Definition
AddShippingAddressIdChangeModel.php:136
Commercetools\History\Models\Change\AddShippingAddressIdChangeModel\$previousValue
$previousValue
Definition
AddShippingAddressIdChangeModel.php:42
Commercetools\History\Models\Change\AddShippingAddressIdChangeModel\getAddress
getAddress()
Definition
AddShippingAddressIdChangeModel.php:156
Commercetools\History\Models\Change\AddShippingAddressIdChangeModel\$type
$type
Definition
AddShippingAddressIdChangeModel.php:30
Commercetools\History\Models\Change\AddShippingAddressIdChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
AddShippingAddressIdChangeModel.php:25
Commercetools\History\Models\Change\AddShippingAddressIdChangeModel\setAddress
setAddress(?Address $address)
Definition
AddShippingAddressIdChangeModel.php:199
Commercetools\History\Models\Change\AddShippingAddressIdChangeModel\getType
getType()
Definition
AddShippingAddressIdChangeModel.php:78
Commercetools\History\Models\Change\AddShippingAddressIdChangeModel\setPreviousValue
setPreviousValue(?array $previousValue)
Definition
AddShippingAddressIdChangeModel.php:183
Commercetools\History\Models\Change\AddShippingAddressIdChangeModel\setChange
setChange(?string $change)
Definition
AddShippingAddressIdChangeModel.php:175
Commercetools\History\Models\Common\AddressModel
Definition
AddressModel.php:21
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\AddShippingAddressIdChange
Definition
AddShippingAddressIdChange.php:16
Commercetools\History\Models\Common\Address
Definition
Address.php:15
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8