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
AddItemShippingAddressesChangeModel.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
AddItemShippingAddressesChangeModel
extends
JsonObjectModel
implements
AddItemShippingAddressesChange
23
{
24
25
public
const
DISCRIMINATOR_VALUE
=
'AddItemShippingAddressesChange'
;
30
protected
$type
;
31
36
protected
$change
;
37
42
protected
$previousValue
;
43
48
protected
$nextValue
;
49
50
54
public
function
__construct
(
55
?
string
$change
=
null
,
56
?
Address
$previousValue
=
null
,
57
?
Address
$nextValue
=
null
,
58
?
string
$type
=
null
59
) {
60
$this->change =
$change
;
61
$this->previousValue =
$previousValue
;
62
$this->nextValue =
$nextValue
;
63
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
64
}
65
70
public
function
getType
()
71
{
72
if
(is_null($this->type)) {
74
$data = $this->
raw
(self::FIELD_TYPE);
75
if
(is_null($data)) {
76
return
null
;
77
}
78
$this->type = (string) $data;
79
}
80
81
return
$this->type
;
82
}
83
88
public
function
getChange
()
89
{
90
if
(is_null($this->change)) {
92
$data = $this->
raw
(self::FIELD_CHANGE);
93
if
(is_null($data)) {
94
return
null
;
95
}
96
$this->change = (string) $data;
97
}
98
99
return
$this->change
;
100
}
101
108
public
function
getPreviousValue
()
109
{
110
if
(is_null($this->previousValue)) {
112
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
113
if
(is_null($data)) {
114
return
null
;
115
}
116
117
$this->previousValue = AddressModel::of($data);
118
}
119
120
return
$this->previousValue
;
121
}
122
129
public
function
getNextValue
()
130
{
131
if
(is_null($this->nextValue)) {
133
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
134
if
(is_null($data)) {
135
return
null
;
136
}
137
138
$this->nextValue = AddressModel::of($data);
139
}
140
141
return
$this->nextValue
;
142
}
143
144
148
public
function
setChange
(?
string
$change
): void
149
{
150
$this->change =
$change
;
151
}
152
156
public
function
setPreviousValue
(?
Address
$previousValue
): void
157
{
158
$this->previousValue =
$previousValue
;
159
}
160
164
public
function
setNextValue
(?
Address
$nextValue
): void
165
{
166
$this->nextValue =
$nextValue
;
167
}
168
169
170
171
}
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\AddItemShippingAddressesChangeModel
Definition
AddItemShippingAddressesChangeModel.php:23
Commercetools\History\Models\Change\AddItemShippingAddressesChangeModel\$type
$type
Definition
AddItemShippingAddressesChangeModel.php:30
Commercetools\History\Models\Change\AddItemShippingAddressesChangeModel\getType
getType()
Definition
AddItemShippingAddressesChangeModel.php:70
Commercetools\History\Models\Change\AddItemShippingAddressesChangeModel\setNextValue
setNextValue(?Address $nextValue)
Definition
AddItemShippingAddressesChangeModel.php:164
Commercetools\History\Models\Change\AddItemShippingAddressesChangeModel\$nextValue
$nextValue
Definition
AddItemShippingAddressesChangeModel.php:48
Commercetools\History\Models\Change\AddItemShippingAddressesChangeModel\$previousValue
$previousValue
Definition
AddItemShippingAddressesChangeModel.php:42
Commercetools\History\Models\Change\AddItemShippingAddressesChangeModel\getNextValue
getNextValue()
Definition
AddItemShippingAddressesChangeModel.php:129
Commercetools\History\Models\Change\AddItemShippingAddressesChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
AddItemShippingAddressesChangeModel.php:25
Commercetools\History\Models\Change\AddItemShippingAddressesChangeModel\setPreviousValue
setPreviousValue(?Address $previousValue)
Definition
AddItemShippingAddressesChangeModel.php:156
Commercetools\History\Models\Change\AddItemShippingAddressesChangeModel\getPreviousValue
getPreviousValue()
Definition
AddItemShippingAddressesChangeModel.php:108
Commercetools\History\Models\Change\AddItemShippingAddressesChangeModel\getChange
getChange()
Definition
AddItemShippingAddressesChangeModel.php:88
Commercetools\History\Models\Change\AddItemShippingAddressesChangeModel\__construct
__construct(?string $change=null, ?Address $previousValue=null, ?Address $nextValue=null, ?string $type=null)
Definition
AddItemShippingAddressesChangeModel.php:54
Commercetools\History\Models\Change\AddItemShippingAddressesChangeModel\$change
$change
Definition
AddItemShippingAddressesChangeModel.php:36
Commercetools\History\Models\Change\AddItemShippingAddressesChangeModel\setChange
setChange(?string $change)
Definition
AddItemShippingAddressesChangeModel.php:148
Commercetools\History\Models\Common\AddressModel
Definition
AddressModel.php:21
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\AddItemShippingAddressesChange
Definition
AddItemShippingAddressesChange.php:16
Commercetools\History\Models\Common\Address
Definition
Address.php:15
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8