commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CannotUpdateReservationWarningModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = 'CannotUpdateReservation';
27 protected $code;
28
33 protected $message;
34
39 protected $lineItemId;
40
46
52
57 protected $productId;
58
63 protected $sku;
64
69 protected $supplyChannel;
70
71
75 public function __construct(
76 ?string $message = null,
77 ?string $lineItemId = null,
78 ?float $requestedQuantity = null,
79 ?float $reservedQuantity = null,
80 ?string $productId = null,
81 ?string $sku = null,
82 ?string $supplyChannel = null,
83 ?string $code = null
84 ) {
85 $this->message = $message;
86 $this->lineItemId = $lineItemId;
87 $this->requestedQuantity = $requestedQuantity;
88 $this->reservedQuantity = $reservedQuantity;
89 $this->productId = $productId;
90 $this->sku = $sku;
91 $this->supplyChannel = $supplyChannel;
92 $this->code = $code ?? self::DISCRIMINATOR_VALUE;
93 }
94
99 public function getCode()
100 {
101 if (is_null($this->code)) {
103 $data = $this->raw(self::FIELD_CODE);
104 if (is_null($data)) {
105 return null;
106 }
107 $this->code = (string) $data;
108 }
109
110 return $this->code;
111 }
112
119 public function getMessage()
120 {
121 if (is_null($this->message)) {
123 $data = $this->raw(self::FIELD_MESSAGE);
124 if (is_null($data)) {
125 return null;
126 }
127 $this->message = (string) $data;
128 }
129
130 return $this->message;
131 }
132
139 public function getLineItemId()
140 {
141 if (is_null($this->lineItemId)) {
143 $data = $this->raw(self::FIELD_LINE_ITEM_ID);
144 if (is_null($data)) {
145 return null;
146 }
147 $this->lineItemId = (string) $data;
148 }
149
150 return $this->lineItemId;
151 }
152
159 public function getRequestedQuantity()
160 {
161 if (is_null($this->requestedQuantity)) {
163 $data = $this->raw(self::FIELD_REQUESTED_QUANTITY);
164 if (is_null($data)) {
165 return null;
166 }
167 $this->requestedQuantity = (float) $data;
168 }
169
171 }
172
179 public function getReservedQuantity()
180 {
181 if (is_null($this->reservedQuantity)) {
183 $data = $this->raw(self::FIELD_RESERVED_QUANTITY);
184 if (is_null($data)) {
185 return null;
186 }
187 $this->reservedQuantity = (float) $data;
188 }
189
191 }
192
199 public function getProductId()
200 {
201 if (is_null($this->productId)) {
203 $data = $this->raw(self::FIELD_PRODUCT_ID);
204 if (is_null($data)) {
205 return null;
206 }
207 $this->productId = (string) $data;
208 }
209
210 return $this->productId;
211 }
212
219 public function getSku()
220 {
221 if (is_null($this->sku)) {
223 $data = $this->raw(self::FIELD_SKU);
224 if (is_null($data)) {
225 return null;
226 }
227 $this->sku = (string) $data;
228 }
229
230 return $this->sku;
231 }
232
239 public function getSupplyChannel()
240 {
241 if (is_null($this->supplyChannel)) {
243 $data = $this->raw(self::FIELD_SUPPLY_CHANNEL);
244 if (is_null($data)) {
245 return null;
246 }
247 $this->supplyChannel = (string) $data;
248 }
249
251 }
252
253
257 public function setMessage(?string $message): void
258 {
259 $this->message = $message;
260 }
261
265 public function setLineItemId(?string $lineItemId): void
266 {
267 $this->lineItemId = $lineItemId;
268 }
269
273 public function setRequestedQuantity(?float $requestedQuantity): void
274 {
275 $this->requestedQuantity = $requestedQuantity;
276 }
277
281 public function setReservedQuantity(?float $reservedQuantity): void
282 {
283 $this->reservedQuantity = $reservedQuantity;
284 }
285
289 public function setProductId(?string $productId): void
290 {
291 $this->productId = $productId;
292 }
293
297 public function setSku(?string $sku): void
298 {
299 $this->sku = $sku;
300 }
301
305 public function setSupplyChannel(?string $supplyChannel): void
306 {
307 $this->supplyChannel = $supplyChannel;
308 }
309}
__construct(?string $message=null, ?string $lineItemId=null, ?float $requestedQuantity=null, ?float $reservedQuantity=null, ?string $productId=null, ?string $sku=null, ?string $supplyChannel=null, ?string $code=null)