commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
OrderFieldBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
21final class OrderFieldBuilder implements Builder
22{
27 private $addReturnInfo;
28
33 private $addParcelToDelivery;
34
39 private $addDeliveries;
40
45 private $removeDelivery;
46
51 private $removeParcelFromDelivery;
52
57 private $setDeliveryAddress;
58
63 private $setParcelMeasurements;
64
69 private $setParcelTrackingData;
70
75 private $setParcelItems;
76
83 public function getAddReturnInfo()
84 {
85 return $this->addReturnInfo instanceof ReturnInfoBuilder ? $this->addReturnInfo->build() : $this->addReturnInfo;
86 }
87
94 public function getAddParcelToDelivery()
95 {
96 return $this->addParcelToDelivery instanceof DeliveryParcelBuilder ? $this->addParcelToDelivery->build() : $this->addParcelToDelivery;
97 }
98
105 public function getAddDeliveries()
106 {
107 return $this->addDeliveries;
108 }
109
116 public function getRemoveDelivery()
117 {
118 return $this->removeDelivery instanceof RemoveDeliveryDraftBuilder ? $this->removeDelivery->build() : $this->removeDelivery;
119 }
120
128 {
129 return $this->removeParcelFromDelivery instanceof RemoveParcelFromDeliveryDraftBuilder ? $this->removeParcelFromDelivery->build() : $this->removeParcelFromDelivery;
130 }
131
138 public function getSetDeliveryAddress()
139 {
140 return $this->setDeliveryAddress instanceof DeliveryAddressDraftBuilder ? $this->setDeliveryAddress->build() : $this->setDeliveryAddress;
141 }
142
149 public function getSetParcelMeasurements()
150 {
151 return $this->setParcelMeasurements instanceof ParcelMeasurementDraftBuilder ? $this->setParcelMeasurements->build() : $this->setParcelMeasurements;
152 }
153
160 public function getSetParcelTrackingData()
161 {
162 return $this->setParcelTrackingData instanceof ParcelTrackingDataBuilder ? $this->setParcelTrackingData->build() : $this->setParcelTrackingData;
163 }
164
171 public function getSetParcelItems()
172 {
173 return $this->setParcelItems;
174 }
175
180 public function withAddReturnInfo(?ReturnInfo $addReturnInfo)
181 {
182 $this->addReturnInfo = $addReturnInfo;
183
184 return $this;
185 }
186
191 public function withAddParcelToDelivery(?DeliveryParcel $addParcelToDelivery)
192 {
193 $this->addParcelToDelivery = $addParcelToDelivery;
194
195 return $this;
196 }
197
202 public function withAddDeliveries(?DeliveryDraftCollection $addDeliveries)
203 {
204 $this->addDeliveries = $addDeliveries;
205
206 return $this;
207 }
208
213 public function withRemoveDelivery(?RemoveDeliveryDraft $removeDelivery)
214 {
215 $this->removeDelivery = $removeDelivery;
216
217 return $this;
218 }
219
224 public function withRemoveParcelFromDelivery(?RemoveParcelFromDeliveryDraft $removeParcelFromDelivery)
225 {
226 $this->removeParcelFromDelivery = $removeParcelFromDelivery;
227
228 return $this;
229 }
230
235 public function withSetDeliveryAddress(?DeliveryAddressDraft $setDeliveryAddress)
236 {
237 $this->setDeliveryAddress = $setDeliveryAddress;
238
239 return $this;
240 }
241
246 public function withSetParcelMeasurements(?ParcelMeasurementDraft $setParcelMeasurements)
247 {
248 $this->setParcelMeasurements = $setParcelMeasurements;
249
250 return $this;
251 }
252
257 public function withSetParcelTrackingData(?ParcelTrackingData $setParcelTrackingData)
258 {
259 $this->setParcelTrackingData = $setParcelTrackingData;
260
261 return $this;
262 }
263
268 public function withSetParcelItems(?ParcelItemsCollection $setParcelItems)
269 {
270 $this->setParcelItems = $setParcelItems;
271
272 return $this;
273 }
274
279 public function withAddReturnInfoBuilder(?ReturnInfoBuilder $addReturnInfo)
280 {
281 $this->addReturnInfo = $addReturnInfo;
282
283 return $this;
284 }
285
290 public function withAddParcelToDeliveryBuilder(?DeliveryParcelBuilder $addParcelToDelivery)
291 {
292 $this->addParcelToDelivery = $addParcelToDelivery;
293
294 return $this;
295 }
296
302 {
303 $this->removeDelivery = $removeDelivery;
304
305 return $this;
306 }
307
313 {
314 $this->removeParcelFromDelivery = $removeParcelFromDelivery;
315
316 return $this;
317 }
318
323 public function withSetDeliveryAddressBuilder(?DeliveryAddressDraftBuilder $setDeliveryAddress)
324 {
325 $this->setDeliveryAddress = $setDeliveryAddress;
326
327 return $this;
328 }
329
335 {
336 $this->setParcelMeasurements = $setParcelMeasurements;
337
338 return $this;
339 }
340
345 public function withSetParcelTrackingDataBuilder(?ParcelTrackingDataBuilder $setParcelTrackingData)
346 {
347 $this->setParcelTrackingData = $setParcelTrackingData;
348
349 return $this;
350 }
351
352 public function build(): OrderField
353 {
354 return new OrderFieldModel(
355 $this->addReturnInfo instanceof ReturnInfoBuilder ? $this->addReturnInfo->build() : $this->addReturnInfo,
356 $this->addParcelToDelivery instanceof DeliveryParcelBuilder ? $this->addParcelToDelivery->build() : $this->addParcelToDelivery,
357 $this->addDeliveries,
358 $this->removeDelivery instanceof RemoveDeliveryDraftBuilder ? $this->removeDelivery->build() : $this->removeDelivery,
359 $this->removeParcelFromDelivery instanceof RemoveParcelFromDeliveryDraftBuilder ? $this->removeParcelFromDelivery->build() : $this->removeParcelFromDelivery,
360 $this->setDeliveryAddress instanceof DeliveryAddressDraftBuilder ? $this->setDeliveryAddress->build() : $this->setDeliveryAddress,
361 $this->setParcelMeasurements instanceof ParcelMeasurementDraftBuilder ? $this->setParcelMeasurements->build() : $this->setParcelMeasurements,
362 $this->setParcelTrackingData instanceof ParcelTrackingDataBuilder ? $this->setParcelTrackingData->build() : $this->setParcelTrackingData,
363 $this->setParcelItems
364 );
365 }
366
367 public static function of(): OrderFieldBuilder
368 {
369 return new self();
370 }
371}
withSetDeliveryAddressBuilder(?DeliveryAddressDraftBuilder $setDeliveryAddress)
withSetParcelTrackingData(?ParcelTrackingData $setParcelTrackingData)
withRemoveDeliveryBuilder(?RemoveDeliveryDraftBuilder $removeDelivery)
withAddParcelToDeliveryBuilder(?DeliveryParcelBuilder $addParcelToDelivery)
withSetParcelTrackingDataBuilder(?ParcelTrackingDataBuilder $setParcelTrackingData)
withRemoveParcelFromDeliveryBuilder(?RemoveParcelFromDeliveryDraftBuilder $removeParcelFromDelivery)
withSetParcelItems(?ParcelItemsCollection $setParcelItems)
withSetParcelMeasurements(?ParcelMeasurementDraft $setParcelMeasurements)
withAddDeliveries(?DeliveryDraftCollection $addDeliveries)
withAddParcelToDelivery(?DeliveryParcel $addParcelToDelivery)
withRemoveParcelFromDelivery(?RemoveParcelFromDeliveryDraft $removeParcelFromDelivery)
withSetParcelMeasurementsBuilder(?ParcelMeasurementDraftBuilder $setParcelMeasurements)
withSetDeliveryAddress(?DeliveryAddressDraft $setDeliveryAddress)