commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-import
src
Models
OrderPatches
DeliveryParcelModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Import\Models\OrderPatches
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use
Commercetools\Import\Models\Orders\DeliveryItemCollection
;
16
use
Commercetools\Import\Models\Orders\ParcelMeasurements
;
17
use
Commercetools\Import\Models\Orders\ParcelMeasurementsModel
;
18
use
Commercetools\Import\Models\Orders\TrackingData
;
19
use
Commercetools\Import\Models\Orders\TrackingDataModel
;
20
use stdClass;
21
25
final
class
DeliveryParcelModel
extends
JsonObjectModel
implements
DeliveryParcel
26
{
31
protected
$deliveryId
;
32
37
protected
$measurements
;
38
43
protected
$trackingData
;
44
49
protected
$items
;
50
51
55
public
function
__construct
(
56
?
string
$deliveryId
=
null
,
57
?
ParcelMeasurements
$measurements
=
null
,
58
?
TrackingData
$trackingData
=
null
,
59
?
DeliveryItemCollection
$items
=
null
60
) {
61
$this->deliveryId =
$deliveryId
;
62
$this->measurements =
$measurements
;
63
$this->trackingData =
$trackingData
;
64
$this->items =
$items
;
65
}
66
71
public
function
getDeliveryId
()
72
{
73
if
(is_null($this->deliveryId)) {
75
$data = $this->
raw
(self::FIELD_DELIVERY_ID);
76
if
(is_null($data)) {
77
return
null
;
78
}
79
$this->deliveryId = (string) $data;
80
}
81
82
return
$this->deliveryId
;
83
}
84
89
public
function
getMeasurements
()
90
{
91
if
(is_null($this->measurements)) {
93
$data = $this->
raw
(self::FIELD_MEASUREMENTS);
94
if
(is_null($data)) {
95
return
null
;
96
}
97
98
$this->measurements = ParcelMeasurementsModel::of($data);
99
}
100
101
return
$this->measurements
;
102
}
103
108
public
function
getTrackingData
()
109
{
110
if
(is_null($this->trackingData)) {
112
$data = $this->
raw
(self::FIELD_TRACKING_DATA);
113
if
(is_null($data)) {
114
return
null
;
115
}
116
117
$this->trackingData = TrackingDataModel::of($data);
118
}
119
120
return
$this->trackingData
;
121
}
122
127
public
function
getItems
()
128
{
129
if
(is_null($this->items)) {
131
$data = $this->
raw
(self::FIELD_ITEMS);
132
if
(is_null($data)) {
133
return
null
;
134
}
135
$this->items = DeliveryItemCollection::fromArray($data);
136
}
137
138
return
$this->items
;
139
}
140
141
145
public
function
setDeliveryId
(?
string
$deliveryId
): void
146
{
147
$this->deliveryId =
$deliveryId
;
148
}
149
153
public
function
setMeasurements
(?
ParcelMeasurements
$measurements
): void
154
{
155
$this->measurements =
$measurements
;
156
}
157
161
public
function
setTrackingData
(?
TrackingData
$trackingData
): void
162
{
163
$this->trackingData =
$trackingData
;
164
}
165
169
public
function
setItems
(?
DeliveryItemCollection
$items
): void
170
{
171
$this->items =
$items
;
172
}
173
}
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\Import\Models\OrderPatches\DeliveryParcelModel
Definition
DeliveryParcelModel.php:26
Commercetools\Import\Models\OrderPatches\DeliveryParcelModel\setMeasurements
setMeasurements(?ParcelMeasurements $measurements)
Definition
DeliveryParcelModel.php:153
Commercetools\Import\Models\OrderPatches\DeliveryParcelModel\$trackingData
$trackingData
Definition
DeliveryParcelModel.php:43
Commercetools\Import\Models\OrderPatches\DeliveryParcelModel\$measurements
$measurements
Definition
DeliveryParcelModel.php:37
Commercetools\Import\Models\OrderPatches\DeliveryParcelModel\setTrackingData
setTrackingData(?TrackingData $trackingData)
Definition
DeliveryParcelModel.php:161
Commercetools\Import\Models\OrderPatches\DeliveryParcelModel\setItems
setItems(?DeliveryItemCollection $items)
Definition
DeliveryParcelModel.php:169
Commercetools\Import\Models\OrderPatches\DeliveryParcelModel\getMeasurements
getMeasurements()
Definition
DeliveryParcelModel.php:89
Commercetools\Import\Models\OrderPatches\DeliveryParcelModel\getDeliveryId
getDeliveryId()
Definition
DeliveryParcelModel.php:71
Commercetools\Import\Models\OrderPatches\DeliveryParcelModel\getTrackingData
getTrackingData()
Definition
DeliveryParcelModel.php:108
Commercetools\Import\Models\OrderPatches\DeliveryParcelModel\$deliveryId
$deliveryId
Definition
DeliveryParcelModel.php:31
Commercetools\Import\Models\OrderPatches\DeliveryParcelModel\__construct
__construct(?string $deliveryId=null, ?ParcelMeasurements $measurements=null, ?TrackingData $trackingData=null, ?DeliveryItemCollection $items=null)
Definition
DeliveryParcelModel.php:55
Commercetools\Import\Models\OrderPatches\DeliveryParcelModel\getItems
getItems()
Definition
DeliveryParcelModel.php:127
Commercetools\Import\Models\OrderPatches\DeliveryParcelModel\$items
$items
Definition
DeliveryParcelModel.php:49
Commercetools\Import\Models\OrderPatches\DeliveryParcelModel\setDeliveryId
setDeliveryId(?string $deliveryId)
Definition
DeliveryParcelModel.php:145
Commercetools\Import\Models\Orders\DeliveryItemCollection
Definition
DeliveryItemCollection.php:22
Commercetools\Import\Models\Orders\ParcelMeasurementsModel
Definition
ParcelMeasurementsModel.php:21
Commercetools\Import\Models\Orders\TrackingDataModel
Definition
TrackingDataModel.php:21
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Import\Models\OrderPatches\DeliveryParcel
Definition
DeliveryParcel.php:18
Commercetools\Import\Models\Orders\ParcelMeasurements
Definition
ParcelMeasurements.php:15
Commercetools\Import\Models\Orders\TrackingData
Definition
TrackingData.php:15
Commercetools\Import\Models\OrderPatches
Definition
DeliveryAddressDraft.php:9
Generated by
1.9.8