commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
InventoryEntryBuilder.php
1<?php
2
3declare(strict_types=1);
10
26use DateTimeImmutable;
27use stdClass;
28
32final class InventoryEntryBuilder implements Builder
33{
38 private $id;
39
44 private $version;
45
50 private $createdAt;
51
56 private $lastModifiedAt;
57
62 private $lastModifiedBy;
63
68 private $createdBy;
69
74 private $key;
75
80 private $sku;
81
86 private $supplyChannel;
87
92 private $quantityOnStock;
93
98 private $availableQuantity;
99
104 private $minCartQuantity;
105
110 private $maxCartQuantity;
111
116 private $restockableInDays;
117
122 private $expectedDelivery;
123
128 private $reservationExpirationInMinutes;
129
134 private $stockLevels;
135
140 private $custom;
141
148 public function getId()
149 {
150 return $this->id;
151 }
152
159 public function getVersion()
160 {
161 return $this->version;
162 }
163
170 public function getCreatedAt()
171 {
172 return $this->createdAt;
173 }
174
181 public function getLastModifiedAt()
182 {
183 return $this->lastModifiedAt;
184 }
185
192 public function getLastModifiedBy()
193 {
194 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
195 }
196
203 public function getCreatedBy()
204 {
205 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
206 }
207
214 public function getKey()
215 {
216 return $this->key;
217 }
218
225 public function getSku()
226 {
227 return $this->sku;
228 }
229
236 public function getSupplyChannel()
237 {
238 return $this->supplyChannel instanceof ChannelReferenceBuilder ? $this->supplyChannel->build() : $this->supplyChannel;
239 }
240
247 public function getQuantityOnStock()
248 {
249 return $this->quantityOnStock;
250 }
251
258 public function getAvailableQuantity()
259 {
260 return $this->availableQuantity;
261 }
262
269 public function getMinCartQuantity()
270 {
271 return $this->minCartQuantity;
272 }
273
280 public function getMaxCartQuantity()
281 {
282 return $this->maxCartQuantity;
283 }
284
291 public function getRestockableInDays()
292 {
293 return $this->restockableInDays;
294 }
295
302 public function getExpectedDelivery()
303 {
304 return $this->expectedDelivery;
305 }
306
318 {
319 return $this->reservationExpirationInMinutes;
320 }
321
328 public function getStockLevels()
329 {
330 return $this->stockLevels instanceof InventoryEntryStockLevelsBuilder ? $this->stockLevels->build() : $this->stockLevels;
331 }
332
339 public function getCustom()
340 {
341 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
342 }
343
348 public function withId(?string $id)
349 {
350 $this->id = $id;
351
352 return $this;
353 }
354
359 public function withVersion(?int $version)
360 {
361 $this->version = $version;
362
363 return $this;
364 }
365
370 public function withCreatedAt(?DateTimeImmutable $createdAt)
371 {
372 $this->createdAt = $createdAt;
373
374 return $this;
375 }
376
381 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
382 {
383 $this->lastModifiedAt = $lastModifiedAt;
384
385 return $this;
386 }
387
392 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
393 {
394 $this->lastModifiedBy = $lastModifiedBy;
395
396 return $this;
397 }
398
403 public function withCreatedBy(?CreatedBy $createdBy)
404 {
405 $this->createdBy = $createdBy;
406
407 return $this;
408 }
409
414 public function withKey(?string $key)
415 {
416 $this->key = $key;
417
418 return $this;
419 }
420
425 public function withSku(?string $sku)
426 {
427 $this->sku = $sku;
428
429 return $this;
430 }
431
436 public function withSupplyChannel(?ChannelReference $supplyChannel)
437 {
438 $this->supplyChannel = $supplyChannel;
439
440 return $this;
441 }
442
447 public function withQuantityOnStock(?int $quantityOnStock)
448 {
449 $this->quantityOnStock = $quantityOnStock;
450
451 return $this;
452 }
453
458 public function withAvailableQuantity(?int $availableQuantity)
459 {
460 $this->availableQuantity = $availableQuantity;
461
462 return $this;
463 }
464
469 public function withMinCartQuantity(?int $minCartQuantity)
470 {
471 $this->minCartQuantity = $minCartQuantity;
472
473 return $this;
474 }
475
480 public function withMaxCartQuantity(?int $maxCartQuantity)
481 {
482 $this->maxCartQuantity = $maxCartQuantity;
483
484 return $this;
485 }
486
491 public function withRestockableInDays(?int $restockableInDays)
492 {
493 $this->restockableInDays = $restockableInDays;
494
495 return $this;
496 }
497
502 public function withExpectedDelivery(?DateTimeImmutable $expectedDelivery)
503 {
504 $this->expectedDelivery = $expectedDelivery;
505
506 return $this;
507 }
508
513 public function withReservationExpirationInMinutes(?int $reservationExpirationInMinutes)
514 {
515 $this->reservationExpirationInMinutes = $reservationExpirationInMinutes;
516
517 return $this;
518 }
519
524 public function withStockLevels(?InventoryEntryStockLevels $stockLevels)
525 {
526 $this->stockLevels = $stockLevels;
527
528 return $this;
529 }
530
535 public function withCustom(?CustomFields $custom)
536 {
537 $this->custom = $custom;
538
539 return $this;
540 }
541
546 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
547 {
548 $this->lastModifiedBy = $lastModifiedBy;
549
550 return $this;
551 }
552
557 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
558 {
559 $this->createdBy = $createdBy;
560
561 return $this;
562 }
563
568 public function withSupplyChannelBuilder(?ChannelReferenceBuilder $supplyChannel)
569 {
570 $this->supplyChannel = $supplyChannel;
571
572 return $this;
573 }
574
580 {
581 $this->stockLevels = $stockLevels;
582
583 return $this;
584 }
585
590 public function withCustomBuilder(?CustomFieldsBuilder $custom)
591 {
592 $this->custom = $custom;
593
594 return $this;
595 }
596
597 public function build(): InventoryEntry
598 {
599 return new InventoryEntryModel(
600 $this->id,
601 $this->version,
602 $this->createdAt,
603 $this->lastModifiedAt,
604 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
605 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
606 $this->key,
607 $this->sku,
608 $this->supplyChannel instanceof ChannelReferenceBuilder ? $this->supplyChannel->build() : $this->supplyChannel,
609 $this->quantityOnStock,
610 $this->availableQuantity,
611 $this->minCartQuantity,
612 $this->maxCartQuantity,
613 $this->restockableInDays,
614 $this->expectedDelivery,
615 $this->reservationExpirationInMinutes,
616 $this->stockLevels instanceof InventoryEntryStockLevelsBuilder ? $this->stockLevels->build() : $this->stockLevels,
617 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom
618 );
619 }
620
621 public static function of(): InventoryEntryBuilder
622 {
623 return new self();
624 }
625}
withId(?string $id)
getMaxCartQuantity()
getSku()
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
withSupplyChannel(?ChannelReference $supplyChannel)
withExpectedDelivery(?DateTimeImmutable $expectedDelivery)
getId()
getRestockableInDays()
withStockLevels(?InventoryEntryStockLevels $stockLevels)
withKey(?string $key)
getVersion()
withCustom(?CustomFields $custom)
getMinCartQuantity()
withMaxCartQuantity(?int $maxCartQuantity)
withCustomBuilder(?CustomFieldsBuilder $custom)
getReservationExpirationInMinutes()
withCreatedAt(?DateTimeImmutable $createdAt)
withCreatedBy(?CreatedBy $createdBy)
getCreatedAt()
withRestockableInDays(?int $restockableInDays)
withSupplyChannelBuilder(?ChannelReferenceBuilder $supplyChannel)
getSupplyChannel()
getStockLevels()
getExpectedDelivery()
getQuantityOnStock()
getKey()
getCreatedBy()
getLastModifiedAt()
withVersion(?int $version)
getLastModifiedBy()
withReservationExpirationInMinutes(?int $reservationExpirationInMinutes)
build()
withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
getCustom()
withCreatedByBuilder(?CreatedByBuilder $createdBy)
static of()
withSku(?string $sku)
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
withQuantityOnStock(?int $quantityOnStock)
withMinCartQuantity(?int $minCartQuantity)
getAvailableQuantity()
withStockLevelsBuilder(?InventoryEntryStockLevelsBuilder $stockLevels)
withAvailableQuantity(?int $availableQuantity)
build()