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
OutOfStockErrorModel.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
OutOfStockErrorModel
extends
JsonObjectModel
implements
OutOfStockError
21
{
22
public
const
DISCRIMINATOR_VALUE
=
'OutOfStock'
;
27
protected
$code
;
28
33
protected
$message
;
34
39
protected
$lineItems
;
40
45
protected
$skus
;
46
47
51
public
function
__construct
(
52
?
string
$message
=
null
,
53
?array
$lineItems
=
null
,
54
?array
$skus
=
null
,
55
?
string
$code
=
null
56
) {
57
$this->message =
$message
;
58
$this->lineItems =
$lineItems
;
59
$this->skus =
$skus
;
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
getSkus
()
128
{
129
if
(is_null($this->skus)) {
131
$data = $this->
raw
(self::FIELD_SKUS);
132
if
(is_null($data)) {
133
return
null
;
134
}
135
$this->skus = $data;
136
}
137
138
return
$this->skus
;
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
setSkus
(?array
$skus
): void
162
{
163
$this->skus =
$skus
;
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\OutOfStockErrorModel
Definition
OutOfStockErrorModel.php:21
Commercetools\Api\Models\Error\OutOfStockErrorModel\getLineItems
getLineItems()
Definition
OutOfStockErrorModel.php:107
Commercetools\Api\Models\Error\OutOfStockErrorModel\getMessage
getMessage()
Definition
OutOfStockErrorModel.php:87
Commercetools\Api\Models\Error\OutOfStockErrorModel\by
by(string $key)
Definition
OutOfStockErrorModel.php:169
Commercetools\Api\Models\Error\OutOfStockErrorModel\setMessage
setMessage(?string $message)
Definition
OutOfStockErrorModel.php:145
Commercetools\Api\Models\Error\OutOfStockErrorModel\getSkus
getSkus()
Definition
OutOfStockErrorModel.php:127
Commercetools\Api\Models\Error\OutOfStockErrorModel\getCode
getCode()
Definition
OutOfStockErrorModel.php:67
Commercetools\Api\Models\Error\OutOfStockErrorModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
OutOfStockErrorModel.php:22
Commercetools\Api\Models\Error\OutOfStockErrorModel\setLineItems
setLineItems(?array $lineItems)
Definition
OutOfStockErrorModel.php:153
Commercetools\Api\Models\Error\OutOfStockErrorModel\setSkus
setSkus(?array $skus)
Definition
OutOfStockErrorModel.php:161
Commercetools\Api\Models\Error\OutOfStockErrorModel\$skus
$skus
Definition
OutOfStockErrorModel.php:45
Commercetools\Api\Models\Error\OutOfStockErrorModel\$message
$message
Definition
OutOfStockErrorModel.php:33
Commercetools\Api\Models\Error\OutOfStockErrorModel\$lineItems
$lineItems
Definition
OutOfStockErrorModel.php:39
Commercetools\Api\Models\Error\OutOfStockErrorModel\$code
$code
Definition
OutOfStockErrorModel.php:27
Commercetools\Api\Models\Error\OutOfStockErrorModel\__construct
__construct(?string $message=null, ?array $lineItems=null, ?array $skus=null, ?string $code=null)
Definition
OutOfStockErrorModel.php:51
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\OutOfStockError
Definition
OutOfStockError.php:15
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Error
Definition
AnonymousIdAlreadyInUseError.php:9
Generated by
1.9.8