commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
InventoryEntryDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
20use DateTimeImmutable;
21use stdClass;
22
26final class InventoryEntryDraftBuilder implements Builder
27{
32 private $sku;
33
38 private $key;
39
44 private $supplyChannel;
45
50 private $quantityOnStock;
51
56 private $minCartQuantity;
57
62 private $maxCartQuantity;
63
68 private $restockableInDays;
69
74 private $expectedDelivery;
75
80 private $reservationExpirationInMinutes;
81
86 private $stockLevels;
87
92 private $custom;
93
100 public function getSku()
101 {
102 return $this->sku;
103 }
104
112 public function getKey()
113 {
114 return $this->key;
115 }
116
123 public function getSupplyChannel()
124 {
125 return $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel;
126 }
127
134 public function getQuantityOnStock()
135 {
136 return $this->quantityOnStock;
137 }
138
145 public function getMinCartQuantity()
146 {
147 return $this->minCartQuantity;
148 }
149
156 public function getMaxCartQuantity()
157 {
158 return $this->maxCartQuantity;
159 }
160
167 public function getRestockableInDays()
168 {
169 return $this->restockableInDays;
170 }
171
178 public function getExpectedDelivery()
179 {
180 return $this->expectedDelivery;
181 }
182
194 {
195 return $this->reservationExpirationInMinutes;
196 }
197
204 public function getStockLevels()
205 {
206 return $this->stockLevels instanceof InventoryEntryStockLevelsBuilder ? $this->stockLevels->build() : $this->stockLevels;
207 }
208
215 public function getCustom()
216 {
217 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
218 }
219
224 public function withSku(?string $sku)
225 {
226 $this->sku = $sku;
227
228 return $this;
229 }
230
235 public function withKey(?string $key)
236 {
237 $this->key = $key;
238
239 return $this;
240 }
241
246 public function withSupplyChannel(?ChannelResourceIdentifier $supplyChannel)
247 {
248 $this->supplyChannel = $supplyChannel;
249
250 return $this;
251 }
252
257 public function withQuantityOnStock(?int $quantityOnStock)
258 {
259 $this->quantityOnStock = $quantityOnStock;
260
261 return $this;
262 }
263
268 public function withMinCartQuantity(?int $minCartQuantity)
269 {
270 $this->minCartQuantity = $minCartQuantity;
271
272 return $this;
273 }
274
279 public function withMaxCartQuantity(?int $maxCartQuantity)
280 {
281 $this->maxCartQuantity = $maxCartQuantity;
282
283 return $this;
284 }
285
290 public function withRestockableInDays(?int $restockableInDays)
291 {
292 $this->restockableInDays = $restockableInDays;
293
294 return $this;
295 }
296
301 public function withExpectedDelivery(?DateTimeImmutable $expectedDelivery)
302 {
303 $this->expectedDelivery = $expectedDelivery;
304
305 return $this;
306 }
307
312 public function withReservationExpirationInMinutes(?int $reservationExpirationInMinutes)
313 {
314 $this->reservationExpirationInMinutes = $reservationExpirationInMinutes;
315
316 return $this;
317 }
318
323 public function withStockLevels(?InventoryEntryStockLevels $stockLevels)
324 {
325 $this->stockLevels = $stockLevels;
326
327 return $this;
328 }
329
334 public function withCustom(?CustomFieldsDraft $custom)
335 {
336 $this->custom = $custom;
337
338 return $this;
339 }
340
346 {
347 $this->supplyChannel = $supplyChannel;
348
349 return $this;
350 }
351
357 {
358 $this->stockLevels = $stockLevels;
359
360 return $this;
361 }
362
368 {
369 $this->custom = $custom;
370
371 return $this;
372 }
373
374 public function build(): InventoryEntryDraft
375 {
376 return new InventoryEntryDraftModel(
377 $this->sku,
378 $this->key,
379 $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel,
380 $this->quantityOnStock,
381 $this->minCartQuantity,
382 $this->maxCartQuantity,
383 $this->restockableInDays,
384 $this->expectedDelivery,
385 $this->reservationExpirationInMinutes,
386 $this->stockLevels instanceof InventoryEntryStockLevelsBuilder ? $this->stockLevels->build() : $this->stockLevels,
387 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom
388 );
389 }
390
391 public static function of(): InventoryEntryDraftBuilder
392 {
393 return new self();
394 }
395}
getStockLevels()
withMinCartQuantity(?int $minCartQuantity)
getSku()
getQuantityOnStock()
withSupplyChannel(?ChannelResourceIdentifier $supplyChannel)
static of()
getSupplyChannel()
withSku(?string $sku)
withExpectedDelivery(?DateTimeImmutable $expectedDelivery)
withRestockableInDays(?int $restockableInDays)
withSupplyChannelBuilder(?ChannelResourceIdentifierBuilder $supplyChannel)
withCustom(?CustomFieldsDraft $custom)
withReservationExpirationInMinutes(?int $reservationExpirationInMinutes)
getExpectedDelivery()
getCustom()
getMinCartQuantity()
withQuantityOnStock(?int $quantityOnStock)
withMaxCartQuantity(?int $maxCartQuantity)
build()
withStockLevels(?InventoryEntryStockLevels $stockLevels)
getReservationExpirationInMinutes()
withStockLevelsBuilder(?InventoryEntryStockLevelsBuilder $stockLevels)
getKey()
withKey(?string $key)
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
getMaxCartQuantity()
getRestockableInDays()
build()