commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
Order
ParcelDraftBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Order
;
10
11
use
Commercetools\Api\Models\Type\CustomFieldsDraft
;
12
use
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
;
13
use
Commercetools\Base\Builder
;
14
use
Commercetools\Base\DateTimeImmutableCollection
;
15
use
Commercetools\Base\JsonObject
;
16
use
Commercetools\Base\JsonObjectModel
;
17
use
Commercetools\Base\MapperFactory
;
18
use stdClass;
19
23
final
class
ParcelDraftBuilder
implements
Builder
24
{
29
private
$key;
30
35
private
$measurements;
36
41
private
$trackingData;
42
47
private
$items;
48
53
private
$custom;
54
61
public
function
getKey
()
62
{
63
return
$this->key;
64
}
65
72
public
function
getMeasurements
()
73
{
74
return
$this->measurements instanceof
ParcelMeasurementsBuilder
? $this->measurements->
build
() : $this->measurements;
75
}
76
83
public
function
getTrackingData
()
84
{
85
return
$this->trackingData instanceof
TrackingDataBuilder
? $this->trackingData->
build
() : $this->trackingData;
86
}
87
94
public
function
getItems
()
95
{
96
return
$this->items;
97
}
98
105
public
function
getCustom
()
106
{
107
return
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom;
108
}
109
114
public
function
withKey
(?
string
$key)
115
{
116
$this->key = $key;
117
118
return
$this;
119
}
120
125
public
function
withMeasurements
(?
ParcelMeasurements
$measurements)
126
{
127
$this->measurements = $measurements;
128
129
return
$this;
130
}
131
136
public
function
withTrackingData
(?
TrackingData
$trackingData)
137
{
138
$this->trackingData = $trackingData;
139
140
return
$this;
141
}
142
147
public
function
withItems
(?
DeliveryItemCollection
$items)
148
{
149
$this->items = $items;
150
151
return
$this;
152
}
153
158
public
function
withCustom
(?
CustomFieldsDraft
$custom)
159
{
160
$this->custom = $custom;
161
162
return
$this;
163
}
164
169
public
function
withMeasurementsBuilder
(?
ParcelMeasurementsBuilder
$measurements)
170
{
171
$this->measurements = $measurements;
172
173
return
$this;
174
}
175
180
public
function
withTrackingDataBuilder
(?
TrackingDataBuilder
$trackingData)
181
{
182
$this->trackingData = $trackingData;
183
184
return
$this;
185
}
186
191
public
function
withCustomBuilder
(?
CustomFieldsDraftBuilder
$custom)
192
{
193
$this->custom = $custom;
194
195
return
$this;
196
}
197
198
public
function
build
():
ParcelDraft
199
{
200
return
new
ParcelDraftModel
(
201
$this->key,
202
$this->measurements instanceof
ParcelMeasurementsBuilder
? $this->measurements->
build
() : $this->measurements,
203
$this->trackingData instanceof
TrackingDataBuilder
? $this->trackingData->
build
() : $this->trackingData,
204
$this->items,
205
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom
206
);
207
}
208
209
public
static
function
of
():
ParcelDraftBuilder
210
{
211
return
new
self
();
212
}
213
}
Commercetools\Api\Models\Order\DeliveryItemCollection
Definition
DeliveryItemCollection.php:22
Commercetools\Api\Models\Order\ParcelDraftBuilder
Definition
ParcelDraftBuilder.php:24
Commercetools\Api\Models\Order\ParcelDraftBuilder\getCustom
getCustom()
Definition
ParcelDraftBuilder.php:105
Commercetools\Api\Models\Order\ParcelDraftBuilder\withItems
withItems(?DeliveryItemCollection $items)
Definition
ParcelDraftBuilder.php:147
Commercetools\Api\Models\Order\ParcelDraftBuilder\withKey
withKey(?string $key)
Definition
ParcelDraftBuilder.php:114
Commercetools\Api\Models\Order\ParcelDraftBuilder\withTrackingDataBuilder
withTrackingDataBuilder(?TrackingDataBuilder $trackingData)
Definition
ParcelDraftBuilder.php:180
Commercetools\Api\Models\Order\ParcelDraftBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
Definition
ParcelDraftBuilder.php:191
Commercetools\Api\Models\Order\ParcelDraftBuilder\getItems
getItems()
Definition
ParcelDraftBuilder.php:94
Commercetools\Api\Models\Order\ParcelDraftBuilder\withMeasurements
withMeasurements(?ParcelMeasurements $measurements)
Definition
ParcelDraftBuilder.php:125
Commercetools\Api\Models\Order\ParcelDraftBuilder\build
build()
Definition
ParcelDraftBuilder.php:198
Commercetools\Api\Models\Order\ParcelDraftBuilder\withTrackingData
withTrackingData(?TrackingData $trackingData)
Definition
ParcelDraftBuilder.php:136
Commercetools\Api\Models\Order\ParcelDraftBuilder\of
static of()
Definition
ParcelDraftBuilder.php:209
Commercetools\Api\Models\Order\ParcelDraftBuilder\getTrackingData
getTrackingData()
Definition
ParcelDraftBuilder.php:83
Commercetools\Api\Models\Order\ParcelDraftBuilder\getMeasurements
getMeasurements()
Definition
ParcelDraftBuilder.php:72
Commercetools\Api\Models\Order\ParcelDraftBuilder\withCustom
withCustom(?CustomFieldsDraft $custom)
Definition
ParcelDraftBuilder.php:158
Commercetools\Api\Models\Order\ParcelDraftBuilder\getKey
getKey()
Definition
ParcelDraftBuilder.php:61
Commercetools\Api\Models\Order\ParcelDraftBuilder\withMeasurementsBuilder
withMeasurementsBuilder(?ParcelMeasurementsBuilder $measurements)
Definition
ParcelDraftBuilder.php:169
Commercetools\Api\Models\Order\ParcelDraftModel
Definition
ParcelDraftModel.php:23
Commercetools\Api\Models\Order\ParcelMeasurementsBuilder
Definition
ParcelMeasurementsBuilder.php:22
Commercetools\Api\Models\Order\ParcelMeasurementsBuilder\build
build()
Definition
ParcelMeasurementsBuilder.php:136
Commercetools\Api\Models\Order\TrackingDataBuilder
Definition
TrackingDataBuilder.php:22
Commercetools\Api\Models\Order\TrackingDataBuilder\build
build()
Definition
TrackingDataBuilder.php:167
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
Definition
CustomFieldsDraftBuilder.php:22
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\build
build()
Definition
CustomFieldsDraftBuilder.php:101
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\Api\Models\Order\ParcelDraft
Definition
ParcelDraft.php:16
Commercetools\Api\Models\Order\ParcelMeasurements
Definition
ParcelMeasurements.php:15
Commercetools\Api\Models\Order\TrackingData
Definition
TrackingData.php:15
Commercetools\Api\Models\Type\CustomFieldsDraft
Definition
CustomFieldsDraft.php:15
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Order
Definition
CustomLineItemImportDraft.php:9
Generated by
1.9.8