commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
Error
ExtensionErrorModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Error
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use stdClass;
16
20
final
class
ExtensionErrorModel
extends
JsonObjectModel
implements
ExtensionError
21
{
26
protected
$code
;
27
32
protected
$message
;
33
38
protected
$extensionId
;
39
44
protected
$extensionKey
;
45
46
50
public
function
__construct
(
51
?
string
$code
=
null
,
52
?
string
$message
=
null
,
53
?
string
$extensionId
=
null
,
54
?
string
$extensionKey
=
null
55
) {
56
$this->code =
$code
;
57
$this->message =
$message
;
58
$this->extensionId =
$extensionId
;
59
$this->extensionKey =
$extensionKey
;
60
}
61
68
public
function
getCode
()
69
{
70
if
(is_null($this->code)) {
72
$data = $this->
raw
(self::FIELD_CODE);
73
if
(is_null($data)) {
74
return
null
;
75
}
76
$this->code = (string) $data;
77
}
78
79
return
$this->code
;
80
}
81
88
public
function
getMessage
()
89
{
90
if
(is_null($this->message)) {
92
$data = $this->
raw
(self::FIELD_MESSAGE);
93
if
(is_null($data)) {
94
return
null
;
95
}
96
$this->message = (string) $data;
97
}
98
99
return
$this->message
;
100
}
101
108
public
function
getExtensionId
()
109
{
110
if
(is_null($this->extensionId)) {
112
$data = $this->
raw
(self::FIELD_EXTENSION_ID);
113
if
(is_null($data)) {
114
return
null
;
115
}
116
$this->extensionId = (string) $data;
117
}
118
119
return
$this->extensionId
;
120
}
121
128
public
function
getExtensionKey
()
129
{
130
if
(is_null($this->extensionKey)) {
132
$data = $this->
raw
(self::FIELD_EXTENSION_KEY);
133
if
(is_null($data)) {
134
return
null
;
135
}
136
$this->extensionKey = (string) $data;
137
}
138
139
return
$this->extensionKey
;
140
}
141
142
146
public
function
setCode
(?
string
$code
): void
147
{
148
$this->code =
$code
;
149
}
150
154
public
function
setMessage
(?
string
$message
): void
155
{
156
$this->message =
$message
;
157
}
158
162
public
function
setExtensionId
(?
string
$extensionId
): void
163
{
164
$this->extensionId =
$extensionId
;
165
}
166
170
public
function
setExtensionKey
(?
string
$extensionKey
): void
171
{
172
$this->extensionKey =
$extensionKey
;
173
}
174
178
public
function
by
(
string
$key)
179
{
180
$data = $this->
raw
($key);
181
if
(is_null($data)) {
182
return
null
;
183
}
184
if
(preg_match(
ExtensionError::FIELD_PATTERN4
, $key) === 1) {
186
return
JsonObjectModel::of($data);
187
}
188
189
return
$data;
190
}
191
}
Commercetools\Api\Models\Error\ExtensionErrorModel
Definition
ExtensionErrorModel.php:21
Commercetools\Api\Models\Error\ExtensionErrorModel\setExtensionId
setExtensionId(?string $extensionId)
Definition
ExtensionErrorModel.php:162
Commercetools\Api\Models\Error\ExtensionErrorModel\getMessage
getMessage()
Definition
ExtensionErrorModel.php:88
Commercetools\Api\Models\Error\ExtensionErrorModel\$message
$message
Definition
ExtensionErrorModel.php:32
Commercetools\Api\Models\Error\ExtensionErrorModel\__construct
__construct(?string $code=null, ?string $message=null, ?string $extensionId=null, ?string $extensionKey=null)
Definition
ExtensionErrorModel.php:50
Commercetools\Api\Models\Error\ExtensionErrorModel\$extensionKey
$extensionKey
Definition
ExtensionErrorModel.php:44
Commercetools\Api\Models\Error\ExtensionErrorModel\$code
$code
Definition
ExtensionErrorModel.php:26
Commercetools\Api\Models\Error\ExtensionErrorModel\setExtensionKey
setExtensionKey(?string $extensionKey)
Definition
ExtensionErrorModel.php:170
Commercetools\Api\Models\Error\ExtensionErrorModel\setCode
setCode(?string $code)
Definition
ExtensionErrorModel.php:146
Commercetools\Api\Models\Error\ExtensionErrorModel\$extensionId
$extensionId
Definition
ExtensionErrorModel.php:38
Commercetools\Api\Models\Error\ExtensionErrorModel\getExtensionId
getExtensionId()
Definition
ExtensionErrorModel.php:108
Commercetools\Api\Models\Error\ExtensionErrorModel\getCode
getCode()
Definition
ExtensionErrorModel.php:68
Commercetools\Api\Models\Error\ExtensionErrorModel\getExtensionKey
getExtensionKey()
Definition
ExtensionErrorModel.php:128
Commercetools\Api\Models\Error\ExtensionErrorModel\setMessage
setMessage(?string $message)
Definition
ExtensionErrorModel.php:154
Commercetools\Api\Models\Error\ExtensionErrorModel\by
by(string $key)
Definition
ExtensionErrorModel.php:178
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition
BaseJsonObject.php:57
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\Api\Models\Error\ExtensionError
Definition
ExtensionError.php:15
Commercetools\Api\Models\Error\ExtensionError\FIELD_PATTERN4
const FIELD_PATTERN4
Definition
ExtensionError.php:20
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Error
Definition
AnonymousIdAlreadyInUseError.php:9
Generated by
1.9.8