commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
OrderPatchImportBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
21final class OrderPatchImportBuilder implements Builder
22{
27 private $orderNumber;
28
33 private $fields;
34
41 public function getOrderNumber()
42 {
43 return $this->orderNumber;
44 }
45
52 public function getFields()
53 {
54 return $this->fields instanceof OrderFieldBuilder ? $this->fields->build() : $this->fields;
55 }
56
61 public function withOrderNumber(?string $orderNumber)
62 {
63 $this->orderNumber = $orderNumber;
64
65 return $this;
66 }
67
72 public function withFields(?OrderField $fields)
73 {
74 $this->fields = $fields;
75
76 return $this;
77 }
78
83 public function withFieldsBuilder(?OrderFieldBuilder $fields)
84 {
85 $this->fields = $fields;
86
87 return $this;
88 }
89
90 public function build(): OrderPatchImport
91 {
92 return new OrderPatchImportModel(
93 $this->orderNumber,
94 $this->fields instanceof OrderFieldBuilder ? $this->fields->build() : $this->fields
95 );
96 }
97
98 public static function of(): OrderPatchImportBuilder
99 {
100 return new self();
101 }
102}