commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
OrderEditBuilder.php
1<?php
2
3declare(strict_types=1);
10
27use DateTimeImmutable;
28use stdClass;
29
33final class OrderEditBuilder implements Builder
34{
39 private $id;
40
45 private $version;
46
51 private $createdAt;
52
57 private $lastModifiedAt;
58
63 private $key;
64
69 private $resource;
70
75 private $stagedActions;
76
81 private $result;
82
87 private $comment;
88
93 private $custom;
94
99 private $lastModifiedBy;
100
105 private $createdBy;
106
113 public function getId()
114 {
115 return $this->id;
116 }
117
124 public function getVersion()
125 {
126 return $this->version;
127 }
128
135 public function getCreatedAt()
136 {
137 return $this->createdAt;
138 }
139
146 public function getLastModifiedAt()
147 {
148 return $this->lastModifiedAt;
149 }
150
157 public function getKey()
158 {
159 return $this->key;
160 }
161
168 public function getResource()
169 {
170 return $this->resource instanceof OrderReferenceBuilder ? $this->resource->build() : $this->resource;
171 }
172
179 public function getStagedActions()
180 {
181 return $this->stagedActions;
182 }
183
191 public function getResult()
192 {
193 return $this->result instanceof OrderEditResultBuilder ? $this->result->build() : $this->result;
194 }
195
202 public function getComment()
203 {
204 return $this->comment;
205 }
206
213 public function getCustom()
214 {
215 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
216 }
217
224 public function getLastModifiedBy()
225 {
226 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
227 }
228
235 public function getCreatedBy()
236 {
237 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
238 }
239
244 public function withId(?string $id)
245 {
246 $this->id = $id;
247
248 return $this;
249 }
250
255 public function withVersion(?int $version)
256 {
257 $this->version = $version;
258
259 return $this;
260 }
261
266 public function withCreatedAt(?DateTimeImmutable $createdAt)
267 {
268 $this->createdAt = $createdAt;
269
270 return $this;
271 }
272
277 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
278 {
279 $this->lastModifiedAt = $lastModifiedAt;
280
281 return $this;
282 }
283
288 public function withKey(?string $key)
289 {
290 $this->key = $key;
291
292 return $this;
293 }
294
299 public function withResource(?OrderReference $resource)
300 {
301 $this->resource = $resource;
302
303 return $this;
304 }
305
311 {
312 $this->stagedActions = $stagedActions;
313
314 return $this;
315 }
316
321 public function withResult(?OrderEditResult $result)
322 {
323 $this->result = $result;
324
325 return $this;
326 }
327
332 public function withComment(?string $comment)
333 {
334 $this->comment = $comment;
335
336 return $this;
337 }
338
343 public function withCustom(?CustomFields $custom)
344 {
345 $this->custom = $custom;
346
347 return $this;
348 }
349
354 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
355 {
356 $this->lastModifiedBy = $lastModifiedBy;
357
358 return $this;
359 }
360
365 public function withCreatedBy(?CreatedBy $createdBy)
366 {
367 $this->createdBy = $createdBy;
368
369 return $this;
370 }
371
376 public function withResourceBuilder(?OrderReferenceBuilder $resource)
377 {
378 $this->resource = $resource;
379
380 return $this;
381 }
382
388 {
389 $this->result = $result;
390
391 return $this;
392 }
393
398 public function withCustomBuilder(?CustomFieldsBuilder $custom)
399 {
400 $this->custom = $custom;
401
402 return $this;
403 }
404
409 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
410 {
411 $this->lastModifiedBy = $lastModifiedBy;
412
413 return $this;
414 }
415
420 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
421 {
422 $this->createdBy = $createdBy;
423
424 return $this;
425 }
426
427 public function build(): OrderEdit
428 {
429 return new OrderEditModel(
430 $this->id,
431 $this->version,
432 $this->createdAt,
433 $this->lastModifiedAt,
434 $this->key,
435 $this->resource instanceof OrderReferenceBuilder ? $this->resource->build() : $this->resource,
436 $this->stagedActions,
437 $this->result instanceof OrderEditResultBuilder ? $this->result->build() : $this->result,
438 $this->comment,
439 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
440 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
441 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy
442 );
443 }
444
445 public static function of(): OrderEditBuilder
446 {
447 return new self();
448 }
449}
withResourceBuilder(?OrderReferenceBuilder $resource)
withStagedActions(?StagedOrderUpdateActionCollection $stagedActions)
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)