commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-history
src
Models
Change
AddPlainEnumValueChangeModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\History\Models\Change
;
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
use
Commercetools\History\Models\Common\AttributePlainEnumValue
;
17
use
Commercetools\History\Models\Common\AttributePlainEnumValueModel
;
18
22
final
class
AddPlainEnumValueChangeModel
extends
JsonObjectModel
implements
AddPlainEnumValueChange
23
{
24
25
public
const
DISCRIMINATOR_VALUE
=
'AddPlainEnumValueChange'
;
30
protected
$type
;
31
36
protected
$change
;
37
42
protected
$nextValue
;
43
48
protected
$attributeName
;
49
50
54
public
function
__construct
(
55
?
string
$change
=
null
,
56
?
AttributePlainEnumValue
$nextValue
=
null
,
57
?
string
$attributeName
=
null
,
58
?
string
$type
=
null
59
) {
60
$this->change =
$change
;
61
$this->nextValue =
$nextValue
;
62
$this->attributeName =
$attributeName
;
63
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
64
}
65
70
public
function
getType
()
71
{
72
if
(is_null($this->type)) {
74
$data = $this->
raw
(self::FIELD_TYPE);
75
if
(is_null($data)) {
76
return
null
;
77
}
78
$this->type = (string) $data;
79
}
80
81
return
$this->type
;
82
}
83
88
public
function
getChange
()
89
{
90
if
(is_null($this->change)) {
92
$data = $this->
raw
(self::FIELD_CHANGE);
93
if
(is_null($data)) {
94
return
null
;
95
}
96
$this->change = (string) $data;
97
}
98
99
return
$this->change
;
100
}
101
108
public
function
getNextValue
()
109
{
110
if
(is_null($this->nextValue)) {
112
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
113
if
(is_null($data)) {
114
return
null
;
115
}
116
117
$this->nextValue =
AttributePlainEnumValueModel::of
($data);
118
}
119
120
return
$this->nextValue
;
121
}
122
129
public
function
getAttributeName
()
130
{
131
if
(is_null($this->attributeName)) {
133
$data = $this->
raw
(self::FIELD_ATTRIBUTE_NAME);
134
if
(is_null($data)) {
135
return
null
;
136
}
137
$this->attributeName = (string) $data;
138
}
139
140
return
$this->attributeName
;
141
}
142
143
147
public
function
setChange
(?
string
$change
): void
148
{
149
$this->change =
$change
;
150
}
151
155
public
function
setNextValue
(?
AttributePlainEnumValue
$nextValue
): void
156
{
157
$this->nextValue =
$nextValue
;
158
}
159
163
public
function
setAttributeName
(?
string
$attributeName
): void
164
{
165
$this->attributeName =
$attributeName
;
166
}
167
168
169
170
}
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\History\Models\Change\AddPlainEnumValueChangeModel
Definition
AddPlainEnumValueChangeModel.php:23
Commercetools\History\Models\Change\AddPlainEnumValueChangeModel\$attributeName
$attributeName
Definition
AddPlainEnumValueChangeModel.php:48
Commercetools\History\Models\Change\AddPlainEnumValueChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
AddPlainEnumValueChangeModel.php:25
Commercetools\History\Models\Change\AddPlainEnumValueChangeModel\getNextValue
getNextValue()
Definition
AddPlainEnumValueChangeModel.php:108
Commercetools\History\Models\Change\AddPlainEnumValueChangeModel\setNextValue
setNextValue(?AttributePlainEnumValue $nextValue)
Definition
AddPlainEnumValueChangeModel.php:155
Commercetools\History\Models\Change\AddPlainEnumValueChangeModel\__construct
__construct(?string $change=null, ?AttributePlainEnumValue $nextValue=null, ?string $attributeName=null, ?string $type=null)
Definition
AddPlainEnumValueChangeModel.php:54
Commercetools\History\Models\Change\AddPlainEnumValueChangeModel\getType
getType()
Definition
AddPlainEnumValueChangeModel.php:70
Commercetools\History\Models\Change\AddPlainEnumValueChangeModel\$change
$change
Definition
AddPlainEnumValueChangeModel.php:36
Commercetools\History\Models\Change\AddPlainEnumValueChangeModel\getAttributeName
getAttributeName()
Definition
AddPlainEnumValueChangeModel.php:129
Commercetools\History\Models\Change\AddPlainEnumValueChangeModel\setAttributeName
setAttributeName(?string $attributeName)
Definition
AddPlainEnumValueChangeModel.php:163
Commercetools\History\Models\Change\AddPlainEnumValueChangeModel\$nextValue
$nextValue
Definition
AddPlainEnumValueChangeModel.php:42
Commercetools\History\Models\Change\AddPlainEnumValueChangeModel\getChange
getChange()
Definition
AddPlainEnumValueChangeModel.php:88
Commercetools\History\Models\Change\AddPlainEnumValueChangeModel\$type
$type
Definition
AddPlainEnumValueChangeModel.php:30
Commercetools\History\Models\Change\AddPlainEnumValueChangeModel\setChange
setChange(?string $change)
Definition
AddPlainEnumValueChangeModel.php:147
Commercetools\History\Models\Common\AttributePlainEnumValueModel
Definition
AttributePlainEnumValueModel.php:21
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\AddPlainEnumValueChange
Definition
AddPlainEnumValueChange.php:16
Commercetools\History\Models\Common\AttributePlainEnumValue
Definition
AttributePlainEnumValue.php:15
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8