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
DuplicatePriceScopeErrorModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Error
;
10
11
use
Commercetools\Api\Models\Common\Price
;
12
use
Commercetools\Api\Models\Common\PriceModel
;
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
DuplicatePriceScopeErrorModel
extends
JsonObjectModel
implements
DuplicatePriceScopeError
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'DuplicatePriceScope'
;
29
protected
$code
;
30
35
protected
$message
;
36
41
protected
$conflictingPrice
;
42
43
47
public
function
__construct
(
48
?
string
$message
=
null
,
49
?
Price
$conflictingPrice
=
null
,
50
?
string
$code
=
null
51
) {
52
$this->message =
$message
;
53
$this->conflictingPrice =
$conflictingPrice
;
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
getConflictingPrice
()
102
{
103
if
(is_null($this->conflictingPrice)) {
105
$data = $this->
raw
(self::FIELD_CONFLICTING_PRICE);
106
if
(is_null($data)) {
107
return
null
;
108
}
109
110
$this->conflictingPrice = PriceModel::of($data);
111
}
112
113
return
$this->conflictingPrice
;
114
}
115
116
120
public
function
setMessage
(?
string
$message
): void
121
{
122
$this->message =
$message
;
123
}
124
128
public
function
setConflictingPrice
(?
Price
$conflictingPrice
): void
129
{
130
$this->conflictingPrice =
$conflictingPrice
;
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\Common\PriceModel
Definition
PriceModel.php:28
Commercetools\Api\Models\Error\DuplicatePriceScopeErrorModel
Definition
DuplicatePriceScopeErrorModel.php:23
Commercetools\Api\Models\Error\DuplicatePriceScopeErrorModel\__construct
__construct(?string $message=null, ?Price $conflictingPrice=null, ?string $code=null)
Definition
DuplicatePriceScopeErrorModel.php:47
Commercetools\Api\Models\Error\DuplicatePriceScopeErrorModel\getCode
getCode()
Definition
DuplicatePriceScopeErrorModel.php:61
Commercetools\Api\Models\Error\DuplicatePriceScopeErrorModel\$conflictingPrice
$conflictingPrice
Definition
DuplicatePriceScopeErrorModel.php:41
Commercetools\Api\Models\Error\DuplicatePriceScopeErrorModel\setConflictingPrice
setConflictingPrice(?Price $conflictingPrice)
Definition
DuplicatePriceScopeErrorModel.php:128
Commercetools\Api\Models\Error\DuplicatePriceScopeErrorModel\getMessage
getMessage()
Definition
DuplicatePriceScopeErrorModel.php:81
Commercetools\Api\Models\Error\DuplicatePriceScopeErrorModel\getConflictingPrice
getConflictingPrice()
Definition
DuplicatePriceScopeErrorModel.php:101
Commercetools\Api\Models\Error\DuplicatePriceScopeErrorModel\$message
$message
Definition
DuplicatePriceScopeErrorModel.php:35
Commercetools\Api\Models\Error\DuplicatePriceScopeErrorModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
DuplicatePriceScopeErrorModel.php:24
Commercetools\Api\Models\Error\DuplicatePriceScopeErrorModel\$code
$code
Definition
DuplicatePriceScopeErrorModel.php:29
Commercetools\Api\Models\Error\DuplicatePriceScopeErrorModel\by
by(string $key)
Definition
DuplicatePriceScopeErrorModel.php:136
Commercetools\Api\Models\Error\DuplicatePriceScopeErrorModel\setMessage
setMessage(?string $message)
Definition
DuplicatePriceScopeErrorModel.php:120
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\Common\Price
Definition
Price.php:19
Commercetools\Api\Models\Error\DuplicatePriceScopeError
Definition
DuplicatePriceScopeError.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Error
Definition
AnonymousIdAlreadyInUseError.php:9
Generated by
1.9.8