commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
QuoteRequestDraftModel.php
1<?php
2
3declare(strict_types=1);
10
21use stdClass;
22
27{
32 protected $cart;
33
38 protected $cartVersion;
39
44 protected $key;
45
50 protected $comment;
51
56 protected $custom;
57
62 protected $state;
63
69
70
74 public function __construct(
76 ?int $cartVersion = null,
77 ?string $key = null,
78 ?string $comment = null,
80 ?StateReference $state = null,
81 ?string $purchaseOrderNumber = null
82 ) {
83 $this->cart = $cart;
84 $this->cartVersion = $cartVersion;
85 $this->key = $key;
86 $this->comment = $comment;
87 $this->custom = $custom;
88 $this->state = $state;
89 $this->purchaseOrderNumber = $purchaseOrderNumber;
90 }
91
100 public function getCart()
101 {
102 if (is_null($this->cart)) {
104 $data = $this->raw(self::FIELD_CART);
105 if (is_null($data)) {
106 return null;
107 }
108
109 $this->cart = CartResourceIdentifierModel::of($data);
110 }
111
112 return $this->cart;
113 }
114
121 public function getCartVersion()
122 {
123 if (is_null($this->cartVersion)) {
125 $data = $this->raw(self::FIELD_CART_VERSION);
126 if (is_null($data)) {
127 return null;
128 }
129 $this->cartVersion = (int) $data;
130 }
131
132 return $this->cartVersion;
133 }
134
141 public function getKey()
142 {
143 if (is_null($this->key)) {
145 $data = $this->raw(self::FIELD_KEY);
146 if (is_null($data)) {
147 return null;
148 }
149 $this->key = (string) $data;
150 }
151
152 return $this->key;
153 }
154
161 public function getComment()
162 {
163 if (is_null($this->comment)) {
165 $data = $this->raw(self::FIELD_COMMENT);
166 if (is_null($data)) {
167 return null;
168 }
169 $this->comment = (string) $data;
170 }
171
172 return $this->comment;
173 }
174
181 public function getCustom()
182 {
183 if (is_null($this->custom)) {
185 $data = $this->raw(self::FIELD_CUSTOM);
186 if (is_null($data)) {
187 return null;
188 }
189
190 $this->custom = CustomFieldsDraftModel::of($data);
191 }
192
193 return $this->custom;
194 }
195
203 public function getState()
204 {
205 if (is_null($this->state)) {
207 $data = $this->raw(self::FIELD_STATE);
208 if (is_null($data)) {
209 return null;
210 }
211
212 $this->state = StateReferenceModel::of($data);
213 }
214
215 return $this->state;
216 }
217
225 public function getPurchaseOrderNumber()
226 {
227 if (is_null($this->purchaseOrderNumber)) {
229 $data = $this->raw(self::FIELD_PURCHASE_ORDER_NUMBER);
230 if (is_null($data)) {
231 return null;
232 }
233 $this->purchaseOrderNumber = (string) $data;
234 }
235
237 }
238
239
243 public function setCart(?CartResourceIdentifier $cart): void
244 {
245 $this->cart = $cart;
246 }
247
251 public function setCartVersion(?int $cartVersion): void
252 {
253 $this->cartVersion = $cartVersion;
254 }
255
259 public function setKey(?string $key): void
260 {
261 $this->key = $key;
262 }
263
267 public function setComment(?string $comment): void
268 {
269 $this->comment = $comment;
270 }
271
275 public function setCustom(?CustomFieldsDraft $custom): void
276 {
277 $this->custom = $custom;
278 }
279
283 public function setState(?StateReference $state): void
284 {
285 $this->state = $state;
286 }
287
291 public function setPurchaseOrderNumber(?string $purchaseOrderNumber): void
292 {
293 $this->purchaseOrderNumber = $purchaseOrderNumber;
294 }
295}
__construct(?CartResourceIdentifier $cart=null, ?int $cartVersion=null, ?string $key=null, ?string $comment=null, ?CustomFieldsDraft $custom=null, ?StateReference $state=null, ?string $purchaseOrderNumber=null)