commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
OrderPatches
DeliveryParcelDraftModel.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
DeliveryParcelDraftModel
extends
JsonObjectModel
implements
DeliveryParcelDraft
26
{
31
protected
$measurements
;
32
37
protected
$trackingData
;
38
43
protected
$items
;
44
45
49
public
function
__construct
(
50
?
ParcelMeasurements
$measurements
=
null
,
51
?
TrackingData
$trackingData
=
null
,
52
?
DeliveryItemCollection
$items
=
null
53
) {
54
$this->measurements =
$measurements
;
55
$this->trackingData =
$trackingData
;
56
$this->items =
$items
;
57
}
58
63
public
function
getMeasurements
()
64
{
65
if
(is_null($this->measurements)) {
67
$data = $this->
raw
(self::FIELD_MEASUREMENTS);
68
if
(is_null($data)) {
69
return
null
;
70
}
71
72
$this->measurements =
ParcelMeasurementsModel::of
($data);
73
}
74
75
return
$this->measurements
;
76
}
77
82
public
function
getTrackingData
()
83
{
84
if
(is_null($this->trackingData)) {
86
$data = $this->
raw
(self::FIELD_TRACKING_DATA);
87
if
(is_null($data)) {
88
return
null
;
89
}
90
91
$this->trackingData =
TrackingDataModel::of
($data);
92
}
93
94
return
$this->trackingData
;
95
}
96
101
public
function
getItems
()
102
{
103
if
(is_null($this->items)) {
105
$data = $this->
raw
(self::FIELD_ITEMS);
106
if
(is_null($data)) {
107
return
null
;
108
}
109
$this->items =
DeliveryItemCollection::fromArray
($data);
110
}
111
112
return
$this->items
;
113
}
114
115
119
public
function
setMeasurements
(?
ParcelMeasurements
$measurements
): void
120
{
121
$this->measurements =
$measurements
;
122
}
123
127
public
function
setTrackingData
(?
TrackingData
$trackingData
): void
128
{
129
$this->trackingData =
$trackingData
;
130
}
131
135
public
function
setItems
(?
DeliveryItemCollection
$items
): void
136
{
137
$this->items =
$items
;
138
}
139
}
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\Import\Models\OrderPatches\DeliveryParcelDraftModel
Definition:
DeliveryParcelDraftModel.php:26
Commercetools\Import\Models\OrderPatches\DeliveryParcelDraftModel\$measurements
$measurements
Definition:
DeliveryParcelDraftModel.php:31
Commercetools\Import\Models\OrderPatches\DeliveryParcelDraftModel\$trackingData
$trackingData
Definition:
DeliveryParcelDraftModel.php:37
Commercetools\Import\Models\OrderPatches\DeliveryParcelDraftModel\__construct
__construct(?ParcelMeasurements $measurements=null, ?TrackingData $trackingData=null, ?DeliveryItemCollection $items=null)
Definition:
DeliveryParcelDraftModel.php:49
Commercetools\Import\Models\OrderPatches\DeliveryParcelDraftModel\getMeasurements
getMeasurements()
Definition:
DeliveryParcelDraftModel.php:63
Commercetools\Import\Models\OrderPatches\DeliveryParcelDraftModel\getTrackingData
getTrackingData()
Definition:
DeliveryParcelDraftModel.php:82
Commercetools\Import\Models\OrderPatches\DeliveryParcelDraftModel\$items
$items
Definition:
DeliveryParcelDraftModel.php:43
Commercetools\Import\Models\OrderPatches\DeliveryParcelDraftModel\getItems
getItems()
Definition:
DeliveryParcelDraftModel.php:101
Commercetools\Import\Models\OrderPatches\DeliveryParcelDraftModel\setMeasurements
setMeasurements(?ParcelMeasurements $measurements)
Definition:
DeliveryParcelDraftModel.php:119
Commercetools\Import\Models\OrderPatches\DeliveryParcelDraftModel\setItems
setItems(?DeliveryItemCollection $items)
Definition:
DeliveryParcelDraftModel.php:135
Commercetools\Import\Models\OrderPatches\DeliveryParcelDraftModel\setTrackingData
setTrackingData(?TrackingData $trackingData)
Definition:
DeliveryParcelDraftModel.php:127
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\DeliveryParcelDraft
Definition:
DeliveryParcelDraft.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.1