commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
InventoryEntryDraftBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
20 use DateTimeImmutable;
21 use stdClass;
22 
26 final class InventoryEntryDraftBuilder implements Builder
27 {
32  private $sku;
33 
38  private $key;
39 
44  private $supplyChannel;
45 
50  private $quantityOnStock;
51 
56  private $restockableInDays;
57 
62  private $expectedDelivery;
63 
68  private $custom;
69 
76  public function getSku()
77  {
78  return $this->sku;
79  }
80 
88  public function getKey()
89  {
90  return $this->key;
91  }
92 
99  public function getSupplyChannel()
100  {
101  return $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel;
102  }
103 
110  public function getQuantityOnStock()
111  {
112  return $this->quantityOnStock;
113  }
114 
121  public function getRestockableInDays()
122  {
123  return $this->restockableInDays;
124  }
125 
132  public function getExpectedDelivery()
133  {
134  return $this->expectedDelivery;
135  }
136 
143  public function getCustom()
144  {
145  return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
146  }
147 
152  public function withSku(?string $sku)
153  {
154  $this->sku = $sku;
155 
156  return $this;
157  }
158 
163  public function withKey(?string $key)
164  {
165  $this->key = $key;
166 
167  return $this;
168  }
169 
174  public function withSupplyChannel(?ChannelResourceIdentifier $supplyChannel)
175  {
176  $this->supplyChannel = $supplyChannel;
177 
178  return $this;
179  }
180 
185  public function withQuantityOnStock(?int $quantityOnStock)
186  {
187  $this->quantityOnStock = $quantityOnStock;
188 
189  return $this;
190  }
191 
196  public function withRestockableInDays(?int $restockableInDays)
197  {
198  $this->restockableInDays = $restockableInDays;
199 
200  return $this;
201  }
202 
207  public function withExpectedDelivery(?DateTimeImmutable $expectedDelivery)
208  {
209  $this->expectedDelivery = $expectedDelivery;
210 
211  return $this;
212  }
213 
218  public function withCustom(?CustomFieldsDraft $custom)
219  {
220  $this->custom = $custom;
221 
222  return $this;
223  }
224 
230  {
231  $this->supplyChannel = $supplyChannel;
232 
233  return $this;
234  }
235 
240  public function withCustomBuilder(?CustomFieldsDraftBuilder $custom)
241  {
242  $this->custom = $custom;
243 
244  return $this;
245  }
246 
247  public function build(): InventoryEntryDraft
248  {
249  return new InventoryEntryDraftModel(
250  $this->sku,
251  $this->key,
252  $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel,
253  $this->quantityOnStock,
254  $this->restockableInDays,
255  $this->expectedDelivery,
256  $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom
257  );
258  }
259 
260  public static function of(): InventoryEntryDraftBuilder
261  {
262  return new self();
263  }
264 }
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()
withQuantityOnStock(?int $quantityOnStock)
build()
getKey()
withKey(?string $key)
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
getRestockableInDays()