commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Error
EditPreviewFailedErrorModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Error
;
10
11
use
Commercetools\Api\Models\OrderEdit\OrderEditPreviewFailure
;
12
use
Commercetools\Api\Models\OrderEdit\OrderEditPreviewFailureModel
;
13
use
Commercetools\Base\DateTimeImmutableCollection
;
14
use
Commercetools\Base\JsonObject
;
15
use
Commercetools\Base\JsonObjectModel
;
16
use
Commercetools\Base\MapperFactory
;
17
use stdClass;
18
22
final
class
EditPreviewFailedErrorModel
extends
JsonObjectModel
implements
EditPreviewFailedError
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'EditPreviewFailed'
;
29
protected
$code
;
30
35
protected
$message
;
36
41
protected
$result
;
42
43
47
public
function
__construct
(
48
?
string
$message
=
null
,
49
?
OrderEditPreviewFailure
$result
=
null
,
50
?
string
$code
=
null
51
) {
52
$this->message =
$message
;
53
$this->result =
$result
;
54
$this->code =
$code
??
self::DISCRIMINATOR_VALUE
;
55
}
56
61
public
function
getCode
()
62
{
63
if
(is_null($this->code)) {
65
$data = $this->
raw
(self::FIELD_CODE);
66
if
(is_null($data)) {
67
return
null
;
68
}
69
$this->code = (string) $data;
70
}
71
72
return
$this->code
;
73
}
74
81
public
function
getMessage
()
82
{
83
if
(is_null($this->message)) {
85
$data = $this->
raw
(self::FIELD_MESSAGE);
86
if
(is_null($data)) {
87
return
null
;
88
}
89
$this->message = (string) $data;
90
}
91
92
return
$this->message
;
93
}
94
101
public
function
getResult
()
102
{
103
if
(is_null($this->result)) {
105
$data = $this->
raw
(self::FIELD_RESULT);
106
if
(is_null($data)) {
107
return
null
;
108
}
109
110
$this->result =
OrderEditPreviewFailureModel::of
($data);
111
}
112
113
return
$this->result
;
114
}
115
116
120
public
function
setMessage
(?
string
$message
): void
121
{
122
$this->message =
$message
;
123
}
124
128
public
function
setResult
(?
OrderEditPreviewFailure
$result
): void
129
{
130
$this->result =
$result
;
131
}
132
136
public
function
by
(
string
$key)
137
{
138
$data = $this->
raw
($key);
139
if
(is_null($data)) {
140
return
null
;
141
}
142
143
return
$data;
144
}
145
}
Commercetools\Api\Models\Error\EditPreviewFailedErrorModel
Definition:
EditPreviewFailedErrorModel.php:23
Commercetools\Api\Models\Error\EditPreviewFailedErrorModel\$message
$message
Definition:
EditPreviewFailedErrorModel.php:35
Commercetools\Api\Models\Error\EditPreviewFailedErrorModel\by
by(string $key)
Definition:
EditPreviewFailedErrorModel.php:136
Commercetools\Api\Models\Error\EditPreviewFailedErrorModel\setMessage
setMessage(?string $message)
Definition:
EditPreviewFailedErrorModel.php:120
Commercetools\Api\Models\Error\EditPreviewFailedErrorModel\getResult
getResult()
Definition:
EditPreviewFailedErrorModel.php:101
Commercetools\Api\Models\Error\EditPreviewFailedErrorModel\getMessage
getMessage()
Definition:
EditPreviewFailedErrorModel.php:81
Commercetools\Api\Models\Error\EditPreviewFailedErrorModel\$result
$result
Definition:
EditPreviewFailedErrorModel.php:41
Commercetools\Api\Models\Error\EditPreviewFailedErrorModel\__construct
__construct(?string $message=null, ?OrderEditPreviewFailure $result=null, ?string $code=null)
Definition:
EditPreviewFailedErrorModel.php:47
Commercetools\Api\Models\Error\EditPreviewFailedErrorModel\setResult
setResult(?OrderEditPreviewFailure $result)
Definition:
EditPreviewFailedErrorModel.php:128
Commercetools\Api\Models\Error\EditPreviewFailedErrorModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
EditPreviewFailedErrorModel.php:24
Commercetools\Api\Models\Error\EditPreviewFailedErrorModel\$code
$code
Definition:
EditPreviewFailedErrorModel.php:29
Commercetools\Api\Models\Error\EditPreviewFailedErrorModel\getCode
getCode()
Definition:
EditPreviewFailedErrorModel.php:61
Commercetools\Api\Models\OrderEdit\OrderEditPreviewFailureModel
Definition:
OrderEditPreviewFailureModel.php:22
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition:
BaseJsonObject.php:57
Commercetools\Base\BaseJsonObject\of
static of($data=null)
Definition:
BaseJsonObject.php:26
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\EditPreviewFailedError
Definition:
EditPreviewFailedError.php:16
Commercetools\Api\Models\OrderEdit\OrderEditPreviewFailure
Definition:
OrderEditPreviewFailure.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Error
Definition:
AnonymousIdAlreadyInUseError.php:9
Generated by
1.9.1