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
PriceChangedErrorModel.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
PriceChangedErrorModel
extends
JsonObjectModel
implements
PriceChangedError
21
{
22
public
const
DISCRIMINATOR_VALUE
=
'PriceChanged'
;
27
protected
$code
;
28
33
protected
$message
;
34
39
protected
$lineItems
;
40
45
protected
$shipping
;
46
47
51
public
function
__construct
(
52
?
string
$message
=
null
,
53
?array
$lineItems
=
null
,
54
?
bool
$shipping
=
null
,
55
?
string
$code
=
null
56
) {
57
$this->message =
$message
;
58
$this->lineItems =
$lineItems
;
59
$this->shipping =
$shipping
;
60
$this->code =
$code
??
self::DISCRIMINATOR_VALUE
;
61
}
62
67
public
function
getCode
()
68
{
69
if
(is_null($this->code)) {
71
$data = $this->
raw
(self::FIELD_CODE);
72
if
(is_null($data)) {
73
return
null
;
74
}
75
$this->code = (string) $data;
76
}
77
78
return
$this->code
;
79
}
80
87
public
function
getMessage
()
88
{
89
if
(is_null($this->message)) {
91
$data = $this->
raw
(self::FIELD_MESSAGE);
92
if
(is_null($data)) {
93
return
null
;
94
}
95
$this->message = (string) $data;
96
}
97
98
return
$this->message
;
99
}
100
107
public
function
getLineItems
()
108
{
109
if
(is_null($this->lineItems)) {
111
$data = $this->
raw
(self::FIELD_LINE_ITEMS);
112
if
(is_null($data)) {
113
return
null
;
114
}
115
$this->lineItems = $data;
116
}
117
118
return
$this->lineItems
;
119
}
120
127
public
function
getShipping
()
128
{
129
if
(is_null($this->shipping)) {
131
$data = $this->
raw
(self::FIELD_SHIPPING);
132
if
(is_null($data)) {
133
return
null
;
134
}
135
$this->shipping = (bool) $data;
136
}
137
138
return
$this->shipping
;
139
}
140
141
145
public
function
setMessage
(?
string
$message
): void
146
{
147
$this->message =
$message
;
148
}
149
153
public
function
setLineItems
(?array
$lineItems
): void
154
{
155
$this->lineItems =
$lineItems
;
156
}
157
161
public
function
setShipping
(?
bool
$shipping
): void
162
{
163
$this->shipping =
$shipping
;
164
}
165
169
public
function
by
(
string
$key)
170
{
171
$data = $this->
raw
($key);
172
if
(is_null($data)) {
173
return
null
;
174
}
175
176
return
$data;
177
}
178
}
Commercetools\Api\Models\Error\PriceChangedErrorModel
Definition
PriceChangedErrorModel.php:21
Commercetools\Api\Models\Error\PriceChangedErrorModel\getLineItems
getLineItems()
Definition
PriceChangedErrorModel.php:107
Commercetools\Api\Models\Error\PriceChangedErrorModel\setShipping
setShipping(?bool $shipping)
Definition
PriceChangedErrorModel.php:161
Commercetools\Api\Models\Error\PriceChangedErrorModel\setLineItems
setLineItems(?array $lineItems)
Definition
PriceChangedErrorModel.php:153
Commercetools\Api\Models\Error\PriceChangedErrorModel\__construct
__construct(?string $message=null, ?array $lineItems=null, ?bool $shipping=null, ?string $code=null)
Definition
PriceChangedErrorModel.php:51
Commercetools\Api\Models\Error\PriceChangedErrorModel\$lineItems
$lineItems
Definition
PriceChangedErrorModel.php:39
Commercetools\Api\Models\Error\PriceChangedErrorModel\$shipping
$shipping
Definition
PriceChangedErrorModel.php:45
Commercetools\Api\Models\Error\PriceChangedErrorModel\$message
$message
Definition
PriceChangedErrorModel.php:33
Commercetools\Api\Models\Error\PriceChangedErrorModel\getMessage
getMessage()
Definition
PriceChangedErrorModel.php:87
Commercetools\Api\Models\Error\PriceChangedErrorModel\$code
$code
Definition
PriceChangedErrorModel.php:27
Commercetools\Api\Models\Error\PriceChangedErrorModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
PriceChangedErrorModel.php:22
Commercetools\Api\Models\Error\PriceChangedErrorModel\getCode
getCode()
Definition
PriceChangedErrorModel.php:67
Commercetools\Api\Models\Error\PriceChangedErrorModel\getShipping
getShipping()
Definition
PriceChangedErrorModel.php:127
Commercetools\Api\Models\Error\PriceChangedErrorModel\setMessage
setMessage(?string $message)
Definition
PriceChangedErrorModel.php:145
Commercetools\Api\Models\Error\PriceChangedErrorModel\by
by(string $key)
Definition
PriceChangedErrorModel.php:169
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\PriceChangedError
Definition
PriceChangedError.php:15
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Error
Definition
AnonymousIdAlreadyInUseError.php:9
Generated by
1.9.8