commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
InventoryQuantityValueModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
21 {
22 
23 
28  protected $quantityOnStock;
29 
34  protected $availableQuantity;
35 
36 
40  public function __construct(
41  ?int $quantityOnStock = null,
42  ?int $availableQuantity = null
43  ) {
44  $this->quantityOnStock = $quantityOnStock;
45  $this->availableQuantity = $availableQuantity;
46 
47  }
48 
55  public function getQuantityOnStock()
56  {
57  if (is_null($this->quantityOnStock)) {
59  $data = $this->raw(self::FIELD_QUANTITY_ON_STOCK);
60  if (is_null($data)) {
61  return null;
62  }
63  $this->quantityOnStock = (int) $data;
64  }
65 
67  }
68 
75  public function getAvailableQuantity()
76  {
77  if (is_null($this->availableQuantity)) {
79  $data = $this->raw(self::FIELD_AVAILABLE_QUANTITY);
80  if (is_null($data)) {
81  return null;
82  }
83  $this->availableQuantity = (int) $data;
84  }
85 
87  }
88 
89 
93  public function setQuantityOnStock(?int $quantityOnStock): void
94  {
95  $this->quantityOnStock = $quantityOnStock;
96  }
97 
101  public function setAvailableQuantity(?int $availableQuantity): void
102  {
103  $this->availableQuantity = $availableQuantity;
104  }
105 
106 
107 
108 }
__construct(?int $quantityOnStock=null, ?int $availableQuantity=null)