commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CannotCreateReservationWarningModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = 'CannotCreateReservation';
27 protected $code;
28
33 protected $message;
34
39 protected $productId;
40
45 protected $sku;
46
51 protected $supplyChannel;
52
57 protected $quantity;
58
59
63 public function __construct(
64 ?string $message = null,
65 ?string $productId = null,
66 ?string $sku = null,
67 ?string $supplyChannel = null,
68 ?float $quantity = null,
69 ?string $code = null
70 ) {
71 $this->message = $message;
72 $this->productId = $productId;
73 $this->sku = $sku;
74 $this->supplyChannel = $supplyChannel;
75 $this->quantity = $quantity;
76 $this->code = $code ?? self::DISCRIMINATOR_VALUE;
77 }
78
83 public function getCode()
84 {
85 if (is_null($this->code)) {
87 $data = $this->raw(self::FIELD_CODE);
88 if (is_null($data)) {
89 return null;
90 }
91 $this->code = (string) $data;
92 }
93
94 return $this->code;
95 }
96
103 public function getMessage()
104 {
105 if (is_null($this->message)) {
107 $data = $this->raw(self::FIELD_MESSAGE);
108 if (is_null($data)) {
109 return null;
110 }
111 $this->message = (string) $data;
112 }
113
114 return $this->message;
115 }
116
123 public function getProductId()
124 {
125 if (is_null($this->productId)) {
127 $data = $this->raw(self::FIELD_PRODUCT_ID);
128 if (is_null($data)) {
129 return null;
130 }
131 $this->productId = (string) $data;
132 }
133
134 return $this->productId;
135 }
136
143 public function getSku()
144 {
145 if (is_null($this->sku)) {
147 $data = $this->raw(self::FIELD_SKU);
148 if (is_null($data)) {
149 return null;
150 }
151 $this->sku = (string) $data;
152 }
153
154 return $this->sku;
155 }
156
163 public function getSupplyChannel()
164 {
165 if (is_null($this->supplyChannel)) {
167 $data = $this->raw(self::FIELD_SUPPLY_CHANNEL);
168 if (is_null($data)) {
169 return null;
170 }
171 $this->supplyChannel = (string) $data;
172 }
173
175 }
176
183 public function getQuantity()
184 {
185 if (is_null($this->quantity)) {
187 $data = $this->raw(self::FIELD_QUANTITY);
188 if (is_null($data)) {
189 return null;
190 }
191 $this->quantity = (float) $data;
192 }
193
194 return $this->quantity;
195 }
196
197
201 public function setMessage(?string $message): void
202 {
203 $this->message = $message;
204 }
205
209 public function setProductId(?string $productId): void
210 {
211 $this->productId = $productId;
212 }
213
217 public function setSku(?string $sku): void
218 {
219 $this->sku = $sku;
220 }
221
225 public function setSupplyChannel(?string $supplyChannel): void
226 {
227 $this->supplyChannel = $supplyChannel;
228 }
229
233 public function setQuantity(?float $quantity): void
234 {
235 $this->quantity = $quantity;
236 }
237}
__construct(?string $message=null, ?string $productId=null, ?string $sku=null, ?string $supplyChannel=null, ?float $quantity=null, ?string $code=null)