commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
InventoryImportBuilder.php
1<?php
2
3declare(strict_types=1);
10
22use DateTimeImmutable;
23use stdClass;
24
28final class InventoryImportBuilder implements Builder
29{
34 private $key;
35
40 private $sku;
41
46 private $quantityOnStock;
47
52 private $restockableInDays;
53
58 private $expectedDelivery;
59
64 private $reservationExpirationInMinutes;
65
70 private $supplyChannel;
71
76 private $custom;
77
84 public function getKey()
85 {
86 return $this->key;
87 }
88
95 public function getSku()
96 {
97 return $this->sku;
98 }
99
106 public function getQuantityOnStock()
107 {
108 return $this->quantityOnStock;
109 }
110
117 public function getRestockableInDays()
118 {
119 return $this->restockableInDays;
120 }
121
128 public function getExpectedDelivery()
129 {
130 return $this->expectedDelivery;
131 }
132
140 {
141 return $this->reservationExpirationInMinutes;
142 }
143
150 public function getSupplyChannel()
151 {
152 return $this->supplyChannel instanceof ChannelKeyReferenceBuilder ? $this->supplyChannel->build() : $this->supplyChannel;
153 }
154
161 public function getCustom()
162 {
163 return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom;
164 }
165
170 public function withKey(?string $key)
171 {
172 $this->key = $key;
173
174 return $this;
175 }
176
181 public function withSku(?string $sku)
182 {
183 $this->sku = $sku;
184
185 return $this;
186 }
187
192 public function withQuantityOnStock(?int $quantityOnStock)
193 {
194 $this->quantityOnStock = $quantityOnStock;
195
196 return $this;
197 }
198
203 public function withRestockableInDays(?int $restockableInDays)
204 {
205 $this->restockableInDays = $restockableInDays;
206
207 return $this;
208 }
209
214 public function withExpectedDelivery(?DateTimeImmutable $expectedDelivery)
215 {
216 $this->expectedDelivery = $expectedDelivery;
217
218 return $this;
219 }
220
225 public function withReservationExpirationInMinutes(?int $reservationExpirationInMinutes)
226 {
227 $this->reservationExpirationInMinutes = $reservationExpirationInMinutes;
228
229 return $this;
230 }
231
236 public function withSupplyChannel(?ChannelKeyReference $supplyChannel)
237 {
238 $this->supplyChannel = $supplyChannel;
239
240 return $this;
241 }
242
247 public function withCustom(?Custom $custom)
248 {
249 $this->custom = $custom;
250
251 return $this;
252 }
253
259 {
260 $this->supplyChannel = $supplyChannel;
261
262 return $this;
263 }
264
269 public function withCustomBuilder(?CustomBuilder $custom)
270 {
271 $this->custom = $custom;
272
273 return $this;
274 }
275
276 public function build(): InventoryImport
277 {
278 return new InventoryImportModel(
279 $this->key,
280 $this->sku,
281 $this->quantityOnStock,
282 $this->restockableInDays,
283 $this->expectedDelivery,
284 $this->reservationExpirationInMinutes,
285 $this->supplyChannel instanceof ChannelKeyReferenceBuilder ? $this->supplyChannel->build() : $this->supplyChannel,
286 $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom
287 );
288 }
289
290 public static function of(): InventoryImportBuilder
291 {
292 return new self();
293 }
294}
withSupplyChannelBuilder(?ChannelKeyReferenceBuilder $supplyChannel)