commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
OrderFromQuoteDraftModel.php
1<?php
2
3declare(strict_types=1);
10
19use stdClass;
20
25{
30 protected $quote;
31
36 protected $version;
37
43
48 protected $orderNumber;
49
54 protected $paymentState;
55
60 protected $shipmentState;
61
66 protected $orderState;
67
72 protected $state;
73
74
78 public function __construct(
80 ?int $version = null,
81 ?bool $quoteStateToAccepted = null,
82 ?string $orderNumber = null,
83 ?string $paymentState = null,
84 ?string $shipmentState = null,
85 ?string $orderState = null,
87 ) {
88 $this->quote = $quote;
89 $this->version = $version;
90 $this->quoteStateToAccepted = $quoteStateToAccepted;
91 $this->orderNumber = $orderNumber;
92 $this->paymentState = $paymentState;
93 $this->shipmentState = $shipmentState;
94 $this->orderState = $orderState;
95 $this->state = $state;
96 }
97
105 public function getQuote()
106 {
107 if (is_null($this->quote)) {
109 $data = $this->raw(self::FIELD_QUOTE);
110 if (is_null($data)) {
111 return null;
112 }
113
114 $this->quote = QuoteResourceIdentifierModel::of($data);
115 }
116
117 return $this->quote;
118 }
119
126 public function getVersion()
127 {
128 if (is_null($this->version)) {
130 $data = $this->raw(self::FIELD_VERSION);
131 if (is_null($data)) {
132 return null;
133 }
134 $this->version = (int) $data;
135 }
136
137 return $this->version;
138 }
139
146 public function getQuoteStateToAccepted()
147 {
148 if (is_null($this->quoteStateToAccepted)) {
150 $data = $this->raw(self::FIELD_QUOTE_STATE_TO_ACCEPTED);
151 if (is_null($data)) {
152 return null;
153 }
154 $this->quoteStateToAccepted = (bool) $data;
155 }
156
158 }
159
167 public function getOrderNumber()
168 {
169 if (is_null($this->orderNumber)) {
171 $data = $this->raw(self::FIELD_ORDER_NUMBER);
172 if (is_null($data)) {
173 return null;
174 }
175 $this->orderNumber = (string) $data;
176 }
177
178 return $this->orderNumber;
179 }
180
187 public function getPaymentState()
188 {
189 if (is_null($this->paymentState)) {
191 $data = $this->raw(self::FIELD_PAYMENT_STATE);
192 if (is_null($data)) {
193 return null;
194 }
195 $this->paymentState = (string) $data;
196 }
197
198 return $this->paymentState;
199 }
200
207 public function getShipmentState()
208 {
209 if (is_null($this->shipmentState)) {
211 $data = $this->raw(self::FIELD_SHIPMENT_STATE);
212 if (is_null($data)) {
213 return null;
214 }
215 $this->shipmentState = (string) $data;
216 }
217
219 }
220
227 public function getOrderState()
228 {
229 if (is_null($this->orderState)) {
231 $data = $this->raw(self::FIELD_ORDER_STATE);
232 if (is_null($data)) {
233 return null;
234 }
235 $this->orderState = (string) $data;
236 }
237
238 return $this->orderState;
239 }
240
247 public function getState()
248 {
249 if (is_null($this->state)) {
251 $data = $this->raw(self::FIELD_STATE);
252 if (is_null($data)) {
253 return null;
254 }
255
256 $this->state = StateResourceIdentifierModel::of($data);
257 }
258
259 return $this->state;
260 }
261
262
267 {
268 $this->quote = $quote;
269 }
270
274 public function setVersion(?int $version): void
275 {
276 $this->version = $version;
277 }
278
283 {
284 $this->quoteStateToAccepted = $quoteStateToAccepted;
285 }
286
290 public function setOrderNumber(?string $orderNumber): void
291 {
292 $this->orderNumber = $orderNumber;
293 }
294
298 public function setPaymentState(?string $paymentState): void
299 {
300 $this->paymentState = $paymentState;
301 }
302
306 public function setShipmentState(?string $shipmentState): void
307 {
308 $this->shipmentState = $shipmentState;
309 }
310
314 public function setOrderState(?string $orderState): void
315 {
316 $this->orderState = $orderState;
317 }
318
323 {
324 $this->state = $state;
325 }
326}
__construct(?QuoteResourceIdentifier $quote=null, ?int $version=null, ?bool $quoteStateToAccepted=null, ?string $orderNumber=null, ?string $paymentState=null, ?string $shipmentState=null, ?string $orderState=null, ?StateResourceIdentifier $state=null)