commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
OrderPatchImportBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
21 final 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 }