commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
OrderFromQuoteDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
20use stdClass;
21
25final class OrderFromQuoteDraftBuilder implements Builder
26{
31 private $quote;
32
37 private $version;
38
43 private $quoteStateToAccepted;
44
49 private $orderNumber;
50
55 private $paymentState;
56
61 private $shipmentState;
62
67 private $orderState;
68
73 private $state;
74
82 public function getQuote()
83 {
84 return $this->quote instanceof QuoteResourceIdentifierBuilder ? $this->quote->build() : $this->quote;
85 }
86
93 public function getVersion()
94 {
95 return $this->version;
96 }
97
104 public function getQuoteStateToAccepted()
105 {
106 return $this->quoteStateToAccepted;
107 }
108
116 public function getOrderNumber()
117 {
118 return $this->orderNumber;
119 }
120
127 public function getPaymentState()
128 {
129 return $this->paymentState;
130 }
131
138 public function getShipmentState()
139 {
140 return $this->shipmentState;
141 }
142
149 public function getOrderState()
150 {
151 return $this->orderState;
152 }
153
160 public function getState()
161 {
162 return $this->state instanceof StateResourceIdentifierBuilder ? $this->state->build() : $this->state;
163 }
164
169 public function withQuote(?QuoteResourceIdentifier $quote)
170 {
171 $this->quote = $quote;
172
173 return $this;
174 }
175
180 public function withVersion(?int $version)
181 {
182 $this->version = $version;
183
184 return $this;
185 }
186
191 public function withQuoteStateToAccepted(?bool $quoteStateToAccepted)
192 {
193 $this->quoteStateToAccepted = $quoteStateToAccepted;
194
195 return $this;
196 }
197
202 public function withOrderNumber(?string $orderNumber)
203 {
204 $this->orderNumber = $orderNumber;
205
206 return $this;
207 }
208
213 public function withPaymentState(?string $paymentState)
214 {
215 $this->paymentState = $paymentState;
216
217 return $this;
218 }
219
224 public function withShipmentState(?string $shipmentState)
225 {
226 $this->shipmentState = $shipmentState;
227
228 return $this;
229 }
230
235 public function withOrderState(?string $orderState)
236 {
237 $this->orderState = $orderState;
238
239 return $this;
240 }
241
246 public function withState(?StateResourceIdentifier $state)
247 {
248 $this->state = $state;
249
250 return $this;
251 }
252
258 {
259 $this->quote = $quote;
260
261 return $this;
262 }
263
269 {
270 $this->state = $state;
271
272 return $this;
273 }
274
275 public function build(): OrderFromQuoteDraft
276 {
277 return new OrderFromQuoteDraftModel(
278 $this->quote instanceof QuoteResourceIdentifierBuilder ? $this->quote->build() : $this->quote,
279 $this->version,
280 $this->quoteStateToAccepted,
281 $this->orderNumber,
282 $this->paymentState,
283 $this->shipmentState,
284 $this->orderState,
285 $this->state instanceof StateResourceIdentifierBuilder ? $this->state->build() : $this->state
286 );
287 }
288
289 public static function of(): OrderFromQuoteDraftBuilder
290 {
291 return new self();
292 }
293}