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 $custom;
129
136 public function getId()
137 {
138 return $this->id;
139 }
140
147 public function getVersion()
148 {
149 return $this->version;
150 }
151
158 public function getCreatedAt()
159 {
160 return $this->createdAt;
161 }
162
169 public function getLastModifiedAt()
170 {
171 return $this->lastModifiedAt;
172 }
173
180 public function getLastModifiedBy()
181 {
182 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
183 }
184
191 public function getCreatedBy()
192 {
193 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
194 }
195
202 public function getKey()
203 {
204 return $this->key;
205 }
206
213 public function getSku()
214 {
215 return $this->sku;
216 }
217
224 public function getSupplyChannel()
225 {
226 return $this->supplyChannel instanceof ChannelReferenceBuilder ? $this->supplyChannel->build() : $this->supplyChannel;
227 }
228
235 public function getQuantityOnStock()
236 {
237 return $this->quantityOnStock;
238 }
239
246 public function getAvailableQuantity()
247 {
248 return $this->availableQuantity;
249 }
250
257 public function getMinCartQuantity()
258 {
259 return $this->minCartQuantity;
260 }
261
268 public function getMaxCartQuantity()
269 {
270 return $this->maxCartQuantity;
271 }
272
279 public function getRestockableInDays()
280 {
281 return $this->restockableInDays;
282 }
283
290 public function getExpectedDelivery()
291 {
292 return $this->expectedDelivery;
293 }
294
301 public function getCustom()
302 {
303 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
304 }
305
310 public function withId(?string $id)
311 {
312 $this->id = $id;
313
314 return $this;
315 }
316
321 public function withVersion(?int $version)
322 {
323 $this->version = $version;
324
325 return $this;
326 }
327
332 public function withCreatedAt(?DateTimeImmutable $createdAt)
333 {
334 $this->createdAt = $createdAt;
335
336 return $this;
337 }
338
343 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
344 {
345 $this->lastModifiedAt = $lastModifiedAt;
346
347 return $this;
348 }
349
354 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
355 {
356 $this->lastModifiedBy = $lastModifiedBy;
357
358 return $this;
359 }
360
365 public function withCreatedBy(?CreatedBy $createdBy)
366 {
367 $this->createdBy = $createdBy;
368
369 return $this;
370 }
371
376 public function withKey(?string $key)
377 {
378 $this->key = $key;
379
380 return $this;
381 }
382
387 public function withSku(?string $sku)
388 {
389 $this->sku = $sku;
390
391 return $this;
392 }
393
398 public function withSupplyChannel(?ChannelReference $supplyChannel)
399 {
400 $this->supplyChannel = $supplyChannel;
401
402 return $this;
403 }
404
409 public function withQuantityOnStock(?int $quantityOnStock)
410 {
411 $this->quantityOnStock = $quantityOnStock;
412
413 return $this;
414 }
415
420 public function withAvailableQuantity(?int $availableQuantity)
421 {
422 $this->availableQuantity = $availableQuantity;
423
424 return $this;
425 }
426
431 public function withMinCartQuantity(?int $minCartQuantity)
432 {
433 $this->minCartQuantity = $minCartQuantity;
434
435 return $this;
436 }
437
442 public function withMaxCartQuantity(?int $maxCartQuantity)
443 {
444 $this->maxCartQuantity = $maxCartQuantity;
445
446 return $this;
447 }
448
453 public function withRestockableInDays(?int $restockableInDays)
454 {
455 $this->restockableInDays = $restockableInDays;
456
457 return $this;
458 }
459
464 public function withExpectedDelivery(?DateTimeImmutable $expectedDelivery)
465 {
466 $this->expectedDelivery = $expectedDelivery;
467
468 return $this;
469 }
470
475 public function withCustom(?CustomFields $custom)
476 {
477 $this->custom = $custom;
478
479 return $this;
480 }
481
486 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
487 {
488 $this->lastModifiedBy = $lastModifiedBy;
489
490 return $this;
491 }
492
497 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
498 {
499 $this->createdBy = $createdBy;
500
501 return $this;
502 }
503
508 public function withSupplyChannelBuilder(?ChannelReferenceBuilder $supplyChannel)
509 {
510 $this->supplyChannel = $supplyChannel;
511
512 return $this;
513 }
514
519 public function withCustomBuilder(?CustomFieldsBuilder $custom)
520 {
521 $this->custom = $custom;
522
523 return $this;
524 }
525
526 public function build(): InventoryEntry
527 {
528 return new InventoryEntryModel(
529 $this->id,
530 $this->version,
531 $this->createdAt,
532 $this->lastModifiedAt,
533 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
534 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
535 $this->key,
536 $this->sku,
537 $this->supplyChannel instanceof ChannelReferenceBuilder ? $this->supplyChannel->build() : $this->supplyChannel,
538 $this->quantityOnStock,
539 $this->availableQuantity,
540 $this->minCartQuantity,
541 $this->maxCartQuantity,
542 $this->restockableInDays,
543 $this->expectedDelivery,
544 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom
545 );
546 }
547
548 public static function of(): InventoryEntryBuilder
549 {
550 return new self();
551 }
552}
withId(?string $id)
getMaxCartQuantity()
getSku()
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
withSupplyChannel(?ChannelReference $supplyChannel)
withExpectedDelivery(?DateTimeImmutable $expectedDelivery)
getId()
getRestockableInDays()
withKey(?string $key)
getVersion()
withCustom(?CustomFields $custom)
getMinCartQuantity()
withMaxCartQuantity(?int $maxCartQuantity)
withCustomBuilder(?CustomFieldsBuilder $custom)
withCreatedAt(?DateTimeImmutable $createdAt)
withCreatedBy(?CreatedBy $createdBy)
getCreatedAt()
withRestockableInDays(?int $restockableInDays)
withSupplyChannelBuilder(?ChannelReferenceBuilder $supplyChannel)
getSupplyChannel()
getExpectedDelivery()
getQuantityOnStock()
getKey()
getCreatedBy()
getLastModifiedAt()
withVersion(?int $version)
getLastModifiedBy()
build()
withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
getCustom()
withCreatedByBuilder(?CreatedByBuilder $createdBy)
static of()
withSku(?string $sku)
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
withQuantityOnStock(?int $quantityOnStock)
withMinCartQuantity(?int $minCartQuantity)
getAvailableQuantity()
withAvailableQuantity(?int $availableQuantity)