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 $custom;
81
88 public function getSku()
89 {
90 return $this->sku;
91 }
92
100 public function getKey()
101 {
102 return $this->key;
103 }
104
111 public function getSupplyChannel()
112 {
113 return $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel;
114 }
115
122 public function getQuantityOnStock()
123 {
124 return $this->quantityOnStock;
125 }
126
133 public function getMinCartQuantity()
134 {
135 return $this->minCartQuantity;
136 }
137
144 public function getMaxCartQuantity()
145 {
146 return $this->maxCartQuantity;
147 }
148
155 public function getRestockableInDays()
156 {
157 return $this->restockableInDays;
158 }
159
166 public function getExpectedDelivery()
167 {
168 return $this->expectedDelivery;
169 }
170
177 public function getCustom()
178 {
179 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
180 }
181
186 public function withSku(?string $sku)
187 {
188 $this->sku = $sku;
189
190 return $this;
191 }
192
197 public function withKey(?string $key)
198 {
199 $this->key = $key;
200
201 return $this;
202 }
203
208 public function withSupplyChannel(?ChannelResourceIdentifier $supplyChannel)
209 {
210 $this->supplyChannel = $supplyChannel;
211
212 return $this;
213 }
214
219 public function withQuantityOnStock(?int $quantityOnStock)
220 {
221 $this->quantityOnStock = $quantityOnStock;
222
223 return $this;
224 }
225
230 public function withMinCartQuantity(?int $minCartQuantity)
231 {
232 $this->minCartQuantity = $minCartQuantity;
233
234 return $this;
235 }
236
241 public function withMaxCartQuantity(?int $maxCartQuantity)
242 {
243 $this->maxCartQuantity = $maxCartQuantity;
244
245 return $this;
246 }
247
252 public function withRestockableInDays(?int $restockableInDays)
253 {
254 $this->restockableInDays = $restockableInDays;
255
256 return $this;
257 }
258
263 public function withExpectedDelivery(?DateTimeImmutable $expectedDelivery)
264 {
265 $this->expectedDelivery = $expectedDelivery;
266
267 return $this;
268 }
269
274 public function withCustom(?CustomFieldsDraft $custom)
275 {
276 $this->custom = $custom;
277
278 return $this;
279 }
280
286 {
287 $this->supplyChannel = $supplyChannel;
288
289 return $this;
290 }
291
297 {
298 $this->custom = $custom;
299
300 return $this;
301 }
302
303 public function build(): InventoryEntryDraft
304 {
305 return new InventoryEntryDraftModel(
306 $this->sku,
307 $this->key,
308 $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel,
309 $this->quantityOnStock,
310 $this->minCartQuantity,
311 $this->maxCartQuantity,
312 $this->restockableInDays,
313 $this->expectedDelivery,
314 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom
315 );
316 }
317
318 public static function of(): InventoryEntryDraftBuilder
319 {
320 return new self();
321 }
322}
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)
getExpectedDelivery()
getCustom()
getMinCartQuantity()
withQuantityOnStock(?int $quantityOnStock)
withMaxCartQuantity(?int $maxCartQuantity)
build()
getKey()
withKey(?string $key)
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
getMaxCartQuantity()
getRestockableInDays()