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
DeliveryParcelBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Import\Models\OrderPatches
;
10
11
use
Commercetools\Base\Builder
;
12
use
Commercetools\Base\DateTimeImmutableCollection
;
13
use
Commercetools\Base\JsonObject
;
14
use
Commercetools\Base\JsonObjectModel
;
15
use
Commercetools\Base\MapperFactory
;
16
use
Commercetools\Import\Models\Orders\DeliveryItemCollection
;
17
use
Commercetools\Import\Models\Orders\ParcelMeasurements
;
18
use
Commercetools\Import\Models\Orders\ParcelMeasurementsBuilder
;
19
use
Commercetools\Import\Models\Orders\TrackingData
;
20
use
Commercetools\Import\Models\Orders\TrackingDataBuilder
;
21
use stdClass;
22
26
final
class
DeliveryParcelBuilder
implements
Builder
27
{
32
private
$deliveryId;
33
38
private
$measurements;
39
44
private
$trackingData;
45
50
private
$items;
51
56
public
function
getDeliveryId
()
57
{
58
return
$this->deliveryId;
59
}
60
65
public
function
getMeasurements
()
66
{
67
return
$this->measurements instanceof
ParcelMeasurementsBuilder
? $this->measurements->
build
() : $this->measurements;
68
}
69
74
public
function
getTrackingData
()
75
{
76
return
$this->trackingData instanceof
TrackingDataBuilder
? $this->trackingData->
build
() : $this->trackingData;
77
}
78
83
public
function
getItems
()
84
{
85
return
$this->items;
86
}
87
92
public
function
withDeliveryId
(?
string
$deliveryId)
93
{
94
$this->deliveryId = $deliveryId;
95
96
return
$this;
97
}
98
103
public
function
withMeasurements
(?
ParcelMeasurements
$measurements)
104
{
105
$this->measurements = $measurements;
106
107
return
$this;
108
}
109
114
public
function
withTrackingData
(?
TrackingData
$trackingData)
115
{
116
$this->trackingData = $trackingData;
117
118
return
$this;
119
}
120
125
public
function
withItems
(?
DeliveryItemCollection
$items)
126
{
127
$this->items = $items;
128
129
return
$this;
130
}
131
136
public
function
withMeasurementsBuilder
(?
ParcelMeasurementsBuilder
$measurements)
137
{
138
$this->measurements = $measurements;
139
140
return
$this;
141
}
142
147
public
function
withTrackingDataBuilder
(?
TrackingDataBuilder
$trackingData)
148
{
149
$this->trackingData = $trackingData;
150
151
return
$this;
152
}
153
154
public
function
build
():
DeliveryParcel
155
{
156
return
new
DeliveryParcelModel
(
157
$this->deliveryId,
158
$this->measurements instanceof
ParcelMeasurementsBuilder
? $this->measurements->
build
() : $this->measurements,
159
$this->trackingData instanceof
TrackingDataBuilder
? $this->trackingData->
build
() : $this->trackingData,
160
$this->items
161
);
162
}
163
164
public
static
function
of
():
DeliveryParcelBuilder
165
{
166
return
new
self
();
167
}
168
}
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\DeliveryParcelBuilder
Definition
DeliveryParcelBuilder.php:27
Commercetools\Import\Models\OrderPatches\DeliveryParcelBuilder\withTrackingDataBuilder
withTrackingDataBuilder(?TrackingDataBuilder $trackingData)
Definition
DeliveryParcelBuilder.php:147
Commercetools\Import\Models\OrderPatches\DeliveryParcelBuilder\withItems
withItems(?DeliveryItemCollection $items)
Definition
DeliveryParcelBuilder.php:125
Commercetools\Import\Models\OrderPatches\DeliveryParcelBuilder\withDeliveryId
withDeliveryId(?string $deliveryId)
Definition
DeliveryParcelBuilder.php:92
Commercetools\Import\Models\OrderPatches\DeliveryParcelBuilder\getTrackingData
getTrackingData()
Definition
DeliveryParcelBuilder.php:74
Commercetools\Import\Models\OrderPatches\DeliveryParcelBuilder\withMeasurements
withMeasurements(?ParcelMeasurements $measurements)
Definition
DeliveryParcelBuilder.php:103
Commercetools\Import\Models\OrderPatches\DeliveryParcelBuilder\getItems
getItems()
Definition
DeliveryParcelBuilder.php:83
Commercetools\Import\Models\OrderPatches\DeliveryParcelBuilder\getDeliveryId
getDeliveryId()
Definition
DeliveryParcelBuilder.php:56
Commercetools\Import\Models\OrderPatches\DeliveryParcelBuilder\getMeasurements
getMeasurements()
Definition
DeliveryParcelBuilder.php:65
Commercetools\Import\Models\OrderPatches\DeliveryParcelBuilder\build
build()
Definition
DeliveryParcelBuilder.php:154
Commercetools\Import\Models\OrderPatches\DeliveryParcelBuilder\withTrackingData
withTrackingData(?TrackingData $trackingData)
Definition
DeliveryParcelBuilder.php:114
Commercetools\Import\Models\OrderPatches\DeliveryParcelBuilder\of
static of()
Definition
DeliveryParcelBuilder.php:164
Commercetools\Import\Models\OrderPatches\DeliveryParcelBuilder\withMeasurementsBuilder
withMeasurementsBuilder(?ParcelMeasurementsBuilder $measurements)
Definition
DeliveryParcelBuilder.php:136
Commercetools\Import\Models\OrderPatches\DeliveryParcelModel
Definition
DeliveryParcelModel.php:26
Commercetools\Import\Models\Orders\DeliveryItemCollection
Definition
DeliveryItemCollection.php:22
Commercetools\Import\Models\Orders\ParcelMeasurementsBuilder
Definition
ParcelMeasurementsBuilder.php:22
Commercetools\Import\Models\Orders\ParcelMeasurementsBuilder\build
build()
Definition
ParcelMeasurementsBuilder.php:128
Commercetools\Import\Models\Orders\TrackingDataBuilder
Definition
TrackingDataBuilder.php:22
Commercetools\Import\Models\Orders\TrackingDataBuilder\build
build()
Definition
TrackingDataBuilder.php:154
Commercetools\Base\Builder
Definition
Builder.php:16
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