commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
All Classes Namespaces Functions Variables Pages
AuthErrorResponseModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
26 protected $statusCode;
27
32 protected $message;
33
38 protected $errors;
39
44 protected $error;
45
51
52
56 public function __construct(
57 ?int $statusCode = null,
58 ?string $message = null,
60 ?string $error = null,
61 ?string $error_description = null
62 ) {
63 $this->statusCode = $statusCode;
64 $this->message = $message;
65 $this->errors = $errors;
66 $this->error = $error;
67 $this->error_description = $error_description;
68 }
69
76 public function getStatusCode()
77 {
78 if (is_null($this->statusCode)) {
80 $data = $this->raw(self::FIELD_STATUS_CODE);
81 if (is_null($data)) {
82 return null;
83 }
84 $this->statusCode = (int) $data;
85 }
86
87 return $this->statusCode;
88 }
89
96 public function getMessage()
97 {
98 if (is_null($this->message)) {
100 $data = $this->raw(self::FIELD_MESSAGE);
101 if (is_null($data)) {
102 return null;
103 }
104 $this->message = (string) $data;
105 }
106
107 return $this->message;
108 }
109
116 public function getErrors()
117 {
118 if (is_null($this->errors)) {
120 $data = $this->raw(self::FIELD_ERRORS);
121 if (is_null($data)) {
122 return null;
123 }
124 $this->errors = ErrorObjectCollection::fromArray($data);
125 }
126
127 return $this->errors;
128 }
129
136 public function getError()
137 {
138 if (is_null($this->error)) {
140 $data = $this->raw(self::FIELD_ERROR);
141 if (is_null($data)) {
142 return null;
143 }
144 $this->error = (string) $data;
145 }
146
147 return $this->error;
148 }
149
156 public function getError_description()
157 {
158 if (is_null($this->error_description)) {
160 $data = $this->raw(self::FIELD_ERROR_DESCRIPTION);
161 if (is_null($data)) {
162 return null;
163 }
164 $this->error_description = (string) $data;
165 }
166
168 }
169
170
174 public function setStatusCode(?int $statusCode): void
175 {
176 $this->statusCode = $statusCode;
177 }
178
182 public function setMessage(?string $message): void
183 {
184 $this->message = $message;
185 }
186
191 {
192 $this->errors = $errors;
193 }
194
198 public function setError(?string $error): void
199 {
200 $this->error = $error;
201 }
202
206 public function setError_description(?string $error_description): void
207 {
208 $this->error_description = $error_description;
209 }
210}
__construct(?int $statusCode=null, ?string $message=null, ?ErrorObjectCollection $errors=null, ?string $error=null, ?string $error_description=null)
static fromArray(array $data)