commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ExtensionErrorBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
21final class ExtensionErrorBuilder implements Builder
22{
27 private $code;
28
33 private $message;
34
39 private $extensionId;
40
45 private $extensionKey;
46
53 public function getCode()
54 {
55 return $this->code;
56 }
57
64 public function getMessage()
65 {
66 return $this->message;
67 }
68
75 public function getExtensionId()
76 {
77 return $this->extensionId;
78 }
79
86 public function getExtensionKey()
87 {
88 return $this->extensionKey;
89 }
90
95 public function withCode(?string $code)
96 {
97 $this->code = $code;
98
99 return $this;
100 }
101
106 public function withMessage(?string $message)
107 {
108 $this->message = $message;
109
110 return $this;
111 }
112
117 public function withExtensionId(?string $extensionId)
118 {
119 $this->extensionId = $extensionId;
120
121 return $this;
122 }
123
128 public function withExtensionKey(?string $extensionKey)
129 {
130 $this->extensionKey = $extensionKey;
131
132 return $this;
133 }
134
135
136 public function build(): ExtensionError
137 {
138 return new ExtensionErrorModel(
139 $this->code,
140 $this->message,
141 $this->extensionId,
142 $this->extensionKey
143 );
144 }
145
146 public static function of(): ExtensionErrorBuilder
147 {
148 return new self();
149 }
150}