commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
VariantAttributesAvailabilityBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
22{
27 private $isOnStock;
28
33 private $restockableInDays;
34
39 private $availableQuantity;
40
45 private $channels;
46
53 public function getIsOnStock()
54 {
55 return $this->isOnStock;
56 }
57
64 public function getRestockableInDays()
65 {
66 return $this->restockableInDays;
67 }
68
75 public function getAvailableQuantity()
76 {
77 return $this->availableQuantity;
78 }
79
87 public function getChannels()
88 {
89 return $this->channels instanceof VariantAttributesChannelAvailabilityMapBuilder ? $this->channels->build() : $this->channels;
90 }
91
96 public function withIsOnStock(?bool $isOnStock)
97 {
98 $this->isOnStock = $isOnStock;
99
100 return $this;
101 }
102
107 public function withRestockableInDays(?int $restockableInDays)
108 {
109 $this->restockableInDays = $restockableInDays;
110
111 return $this;
112 }
113
118 public function withAvailableQuantity(?int $availableQuantity)
119 {
120 $this->availableQuantity = $availableQuantity;
121
122 return $this;
123 }
124
130 {
131 $this->channels = $channels;
132
133 return $this;
134 }
135
141 {
142 $this->channels = $channels;
143
144 return $this;
145 }
146
148 {
150 $this->isOnStock,
151 $this->restockableInDays,
152 $this->availableQuantity,
153 $this->channels instanceof VariantAttributesChannelAvailabilityMapBuilder ? $this->channels->build() : $this->channels
154 );
155 }
156
157 public static function of(): VariantAttributesAvailabilityBuilder
158 {
159 return new self();
160 }
161}