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
SetParcelMeasurementsChangeModel.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\ParcelMeasurements
;
19
use
Commercetools\History\Models\Common\ParcelMeasurementsModel
;
20
24
final
class
SetParcelMeasurementsChangeModel
extends
JsonObjectModel
implements
SetParcelMeasurementsChange
25
{
26
27
public
const
DISCRIMINATOR_VALUE
=
'SetParcelMeasurementsChange'
;
32
protected
$type
;
33
38
protected
$change
;
39
44
protected
$previousValue
;
45
50
protected
$nextValue
;
51
56
protected
$parcel
;
57
58
62
public
function
__construct
(
63
?
string
$change
=
null
,
64
?
ParcelMeasurements
$previousValue
=
null
,
65
?
ParcelMeasurements
$nextValue
=
null
,
66
?
ParcelChangeValue
$parcel
=
null
,
67
?
string
$type
=
null
68
) {
69
$this->change =
$change
;
70
$this->previousValue =
$previousValue
;
71
$this->nextValue =
$nextValue
;
72
$this->parcel =
$parcel
;
73
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
74
}
75
80
public
function
getType
()
81
{
82
if
(is_null($this->type)) {
84
$data = $this->
raw
(self::FIELD_TYPE);
85
if
(is_null($data)) {
86
return
null
;
87
}
88
$this->type = (string) $data;
89
}
90
91
return
$this->type
;
92
}
93
98
public
function
getChange
()
99
{
100
if
(is_null($this->change)) {
102
$data = $this->
raw
(self::FIELD_CHANGE);
103
if
(is_null($data)) {
104
return
null
;
105
}
106
$this->change = (string) $data;
107
}
108
109
return
$this->change
;
110
}
111
118
public
function
getPreviousValue
()
119
{
120
if
(is_null($this->previousValue)) {
122
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
123
if
(is_null($data)) {
124
return
null
;
125
}
126
127
$this->previousValue =
ParcelMeasurementsModel::of
($data);
128
}
129
130
return
$this->previousValue
;
131
}
132
139
public
function
getNextValue
()
140
{
141
if
(is_null($this->nextValue)) {
143
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
144
if
(is_null($data)) {
145
return
null
;
146
}
147
148
$this->nextValue =
ParcelMeasurementsModel::of
($data);
149
}
150
151
return
$this->nextValue
;
152
}
153
160
public
function
getParcel
()
161
{
162
if
(is_null($this->parcel)) {
164
$data = $this->
raw
(self::FIELD_PARCEL);
165
if
(is_null($data)) {
166
return
null
;
167
}
168
169
$this->parcel = ParcelChangeValueModel::of($data);
170
}
171
172
return
$this->parcel
;
173
}
174
175
179
public
function
setChange
(?
string
$change
): void
180
{
181
$this->change =
$change
;
182
}
183
187
public
function
setPreviousValue
(?
ParcelMeasurements
$previousValue
): void
188
{
189
$this->previousValue =
$previousValue
;
190
}
191
195
public
function
setNextValue
(?
ParcelMeasurements
$nextValue
): void
196
{
197
$this->nextValue =
$nextValue
;
198
}
199
203
public
function
setParcel
(?
ParcelChangeValue
$parcel
): void
204
{
205
$this->parcel =
$parcel
;
206
}
207
208
209
210
}
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition
BaseJsonObject.php:57
Commercetools\Base\BaseJsonObject\of
static of($data=null)
Definition
BaseJsonObject.php:26
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\SetParcelMeasurementsChangeModel
Definition
SetParcelMeasurementsChangeModel.php:25
Commercetools\History\Models\Change\SetParcelMeasurementsChangeModel\getNextValue
getNextValue()
Definition
SetParcelMeasurementsChangeModel.php:139
Commercetools\History\Models\Change\SetParcelMeasurementsChangeModel\$change
$change
Definition
SetParcelMeasurementsChangeModel.php:38
Commercetools\History\Models\Change\SetParcelMeasurementsChangeModel\getType
getType()
Definition
SetParcelMeasurementsChangeModel.php:80
Commercetools\History\Models\Change\SetParcelMeasurementsChangeModel\getChange
getChange()
Definition
SetParcelMeasurementsChangeModel.php:98
Commercetools\History\Models\Change\SetParcelMeasurementsChangeModel\setParcel
setParcel(?ParcelChangeValue $parcel)
Definition
SetParcelMeasurementsChangeModel.php:203
Commercetools\History\Models\Change\SetParcelMeasurementsChangeModel\__construct
__construct(?string $change=null, ?ParcelMeasurements $previousValue=null, ?ParcelMeasurements $nextValue=null, ?ParcelChangeValue $parcel=null, ?string $type=null)
Definition
SetParcelMeasurementsChangeModel.php:62
Commercetools\History\Models\Change\SetParcelMeasurementsChangeModel\setNextValue
setNextValue(?ParcelMeasurements $nextValue)
Definition
SetParcelMeasurementsChangeModel.php:195
Commercetools\History\Models\Change\SetParcelMeasurementsChangeModel\getPreviousValue
getPreviousValue()
Definition
SetParcelMeasurementsChangeModel.php:118
Commercetools\History\Models\Change\SetParcelMeasurementsChangeModel\setChange
setChange(?string $change)
Definition
SetParcelMeasurementsChangeModel.php:179
Commercetools\History\Models\Change\SetParcelMeasurementsChangeModel\setPreviousValue
setPreviousValue(?ParcelMeasurements $previousValue)
Definition
SetParcelMeasurementsChangeModel.php:187
Commercetools\History\Models\Change\SetParcelMeasurementsChangeModel\$previousValue
$previousValue
Definition
SetParcelMeasurementsChangeModel.php:44
Commercetools\History\Models\Change\SetParcelMeasurementsChangeModel\$type
$type
Definition
SetParcelMeasurementsChangeModel.php:32
Commercetools\History\Models\Change\SetParcelMeasurementsChangeModel\$parcel
$parcel
Definition
SetParcelMeasurementsChangeModel.php:56
Commercetools\History\Models\Change\SetParcelMeasurementsChangeModel\$nextValue
$nextValue
Definition
SetParcelMeasurementsChangeModel.php:50
Commercetools\History\Models\Change\SetParcelMeasurementsChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
SetParcelMeasurementsChangeModel.php:27
Commercetools\History\Models\Change\SetParcelMeasurementsChangeModel\getParcel
getParcel()
Definition
SetParcelMeasurementsChangeModel.php:160
Commercetools\History\Models\ChangeValue\ParcelChangeValueModel
Definition
ParcelChangeValueModel.php:21
Commercetools\History\Models\Common\ParcelMeasurementsModel
Definition
ParcelMeasurementsModel.php:21
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\SetParcelMeasurementsChange
Definition
SetParcelMeasurementsChange.php:17
Commercetools\History\Models\ChangeValue\ParcelChangeValue
Definition
ParcelChangeValue.php:15
Commercetools\History\Models\Common\ParcelMeasurements
Definition
ParcelMeasurements.php:15
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8