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
ReferenceExistsErrorModel.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
ReferenceExistsErrorModel
extends
JsonObjectModel
implements
ReferenceExistsError
21
{
22
public
const
DISCRIMINATOR_VALUE
=
'ReferenceExists'
;
27
protected
$code
;
28
33
protected
$message
;
34
39
protected
$referencedBy
;
40
41
45
public
function
__construct
(
46
?
string
$message
=
null
,
47
?
string
$referencedBy
=
null
,
48
?
string
$code
=
null
49
) {
50
$this->message =
$message
;
51
$this->referencedBy =
$referencedBy
;
52
$this->code =
$code
??
self::DISCRIMINATOR_VALUE
;
53
}
54
59
public
function
getCode
()
60
{
61
if
(is_null($this->code)) {
63
$data = $this->
raw
(self::FIELD_CODE);
64
if
(is_null($data)) {
65
return
null
;
66
}
67
$this->code = (string) $data;
68
}
69
70
return
$this->code
;
71
}
72
79
public
function
getMessage
()
80
{
81
if
(is_null($this->message)) {
83
$data = $this->
raw
(self::FIELD_MESSAGE);
84
if
(is_null($data)) {
85
return
null
;
86
}
87
$this->message = (string) $data;
88
}
89
90
return
$this->message
;
91
}
92
99
public
function
getReferencedBy
()
100
{
101
if
(is_null($this->referencedBy)) {
103
$data = $this->
raw
(self::FIELD_REFERENCED_BY);
104
if
(is_null($data)) {
105
return
null
;
106
}
107
$this->referencedBy = (string) $data;
108
}
109
110
return
$this->referencedBy
;
111
}
112
113
117
public
function
setMessage
(?
string
$message
): void
118
{
119
$this->message =
$message
;
120
}
121
125
public
function
setReferencedBy
(?
string
$referencedBy
): void
126
{
127
$this->referencedBy =
$referencedBy
;
128
}
129
133
public
function
by
(
string
$key)
134
{
135
$data = $this->
raw
($key);
136
if
(is_null($data)) {
137
return
null
;
138
}
139
140
return
$data;
141
}
142
}
Commercetools\Api\Models\Error\ReferenceExistsErrorModel
Definition
ReferenceExistsErrorModel.php:21
Commercetools\Api\Models\Error\ReferenceExistsErrorModel\$referencedBy
$referencedBy
Definition
ReferenceExistsErrorModel.php:39
Commercetools\Api\Models\Error\ReferenceExistsErrorModel\setReferencedBy
setReferencedBy(?string $referencedBy)
Definition
ReferenceExistsErrorModel.php:125
Commercetools\Api\Models\Error\ReferenceExistsErrorModel\getCode
getCode()
Definition
ReferenceExistsErrorModel.php:59
Commercetools\Api\Models\Error\ReferenceExistsErrorModel\$message
$message
Definition
ReferenceExistsErrorModel.php:33
Commercetools\Api\Models\Error\ReferenceExistsErrorModel\by
by(string $key)
Definition
ReferenceExistsErrorModel.php:133
Commercetools\Api\Models\Error\ReferenceExistsErrorModel\__construct
__construct(?string $message=null, ?string $referencedBy=null, ?string $code=null)
Definition
ReferenceExistsErrorModel.php:45
Commercetools\Api\Models\Error\ReferenceExistsErrorModel\$code
$code
Definition
ReferenceExistsErrorModel.php:27
Commercetools\Api\Models\Error\ReferenceExistsErrorModel\setMessage
setMessage(?string $message)
Definition
ReferenceExistsErrorModel.php:117
Commercetools\Api\Models\Error\ReferenceExistsErrorModel\getMessage
getMessage()
Definition
ReferenceExistsErrorModel.php:79
Commercetools\Api\Models\Error\ReferenceExistsErrorModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
ReferenceExistsErrorModel.php:22
Commercetools\Api\Models\Error\ReferenceExistsErrorModel\getReferencedBy
getReferencedBy()
Definition
ReferenceExistsErrorModel.php:99
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\ReferenceExistsError
Definition
ReferenceExistsError.php:15
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Error
Definition
AnonymousIdAlreadyInUseError.php:9
Generated by
1.9.8