commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-history
src
Models
ChangeValue
DeliveryChangeValueModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\History\Models\ChangeValue
;
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
use
Commercetools\History\Models\Common\DeliveryItemCollection
;
19
use
Commercetools\History\Models\Common\ParcelCollection
;
20
24
final
class
DeliveryChangeValueModel
extends
JsonObjectModel
implements
DeliveryChangeValue
25
{
26
27
32
protected
$items
;
33
38
protected
$address
;
39
44
protected
$parcels
;
45
46
50
public
function
__construct
(
51
?
DeliveryItemCollection
$items
=
null
,
52
?
Address
$address
=
null
,
53
?
ParcelCollection
$parcels
=
null
54
) {
55
$this->items =
$items
;
56
$this->address =
$address
;
57
$this->parcels =
$parcels
;
58
59
}
60
67
public
function
getItems
()
68
{
69
if
(is_null($this->items)) {
71
$data = $this->
raw
(self::FIELD_ITEMS);
72
if
(is_null($data)) {
73
return
null
;
74
}
75
$this->items =
DeliveryItemCollection::fromArray
($data);
76
}
77
78
return
$this->items
;
79
}
80
87
public
function
getAddress
()
88
{
89
if
(is_null($this->address)) {
91
$data = $this->
raw
(self::FIELD_ADDRESS);
92
if
(is_null($data)) {
93
return
null
;
94
}
95
96
$this->address =
AddressModel::of
($data);
97
}
98
99
return
$this->address
;
100
}
101
108
public
function
getParcels
()
109
{
110
if
(is_null($this->parcels)) {
112
$data = $this->
raw
(self::FIELD_PARCELS);
113
if
(is_null($data)) {
114
return
null
;
115
}
116
$this->parcels =
ParcelCollection::fromArray
($data);
117
}
118
119
return
$this->parcels
;
120
}
121
122
126
public
function
setItems
(?
DeliveryItemCollection
$items
): void
127
{
128
$this->items =
$items
;
129
}
130
134
public
function
setAddress
(?
Address
$address
): void
135
{
136
$this->address =
$address
;
137
}
138
142
public
function
setParcels
(?
ParcelCollection
$parcels
): void
143
{
144
$this->parcels =
$parcels
;
145
}
146
147
148
149
}
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\Base\MapperSequence\fromArray
static fromArray(array $data)
Definition:
MapperSequence.php:56
Commercetools\History\Models\ChangeValue\DeliveryChangeValueModel
Definition:
DeliveryChangeValueModel.php:25
Commercetools\History\Models\ChangeValue\DeliveryChangeValueModel\$address
$address
Definition:
DeliveryChangeValueModel.php:38
Commercetools\History\Models\ChangeValue\DeliveryChangeValueModel\getItems
getItems()
Definition:
DeliveryChangeValueModel.php:67
Commercetools\History\Models\ChangeValue\DeliveryChangeValueModel\getAddress
getAddress()
Definition:
DeliveryChangeValueModel.php:87
Commercetools\History\Models\ChangeValue\DeliveryChangeValueModel\setItems
setItems(?DeliveryItemCollection $items)
Definition:
DeliveryChangeValueModel.php:126
Commercetools\History\Models\ChangeValue\DeliveryChangeValueModel\getParcels
getParcels()
Definition:
DeliveryChangeValueModel.php:108
Commercetools\History\Models\ChangeValue\DeliveryChangeValueModel\$items
$items
Definition:
DeliveryChangeValueModel.php:32
Commercetools\History\Models\ChangeValue\DeliveryChangeValueModel\$parcels
$parcels
Definition:
DeliveryChangeValueModel.php:44
Commercetools\History\Models\ChangeValue\DeliveryChangeValueModel\setParcels
setParcels(?ParcelCollection $parcels)
Definition:
DeliveryChangeValueModel.php:142
Commercetools\History\Models\ChangeValue\DeliveryChangeValueModel\__construct
__construct(?DeliveryItemCollection $items=null, ?Address $address=null, ?ParcelCollection $parcels=null)
Definition:
DeliveryChangeValueModel.php:50
Commercetools\History\Models\ChangeValue\DeliveryChangeValueModel\setAddress
setAddress(?Address $address)
Definition:
DeliveryChangeValueModel.php:134
Commercetools\History\Models\Common\AddressModel
Definition:
AddressModel.php:21
Commercetools\History\Models\Common\DeliveryItemCollection
Definition:
DeliveryItemCollection.php:22
Commercetools\History\Models\Common\ParcelCollection
Definition:
ParcelCollection.php:22
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\History\Models\ChangeValue\DeliveryChangeValue
Definition:
DeliveryChangeValue.php:18
Commercetools\History\Models\Common\Address
Definition:
Address.php:15
Commercetools\History\Models\ChangeValue
Definition:
AssetChangeValue.php:9
Generated by
1.9.1