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
ChangeValueChangeModel.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\ChangeValue\ChangeValueChangeValue
;
17
use
Commercetools\History\Models\ChangeValue\ChangeValueChangeValueModel
;
18
22
final
class
ChangeValueChangeModel
extends
JsonObjectModel
implements
ChangeValueChange
23
{
24
25
public
const
DISCRIMINATOR_VALUE
=
'ChangeValueChange'
;
30
protected
$type
;
31
36
protected
$change
;
37
42
protected
$previousValue
;
43
48
protected
$nextValue
;
49
50
54
public
function
__construct
(
55
?
string
$change
=
null
,
56
?
ChangeValueChangeValue
$previousValue
=
null
,
57
?
ChangeValueChangeValue
$nextValue
=
null
,
58
?
string
$type
=
null
59
) {
60
$this->change =
$change
;
61
$this->previousValue =
$previousValue
;
62
$this->nextValue =
$nextValue
;
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
getPreviousValue
()
109
{
110
if
(is_null($this->previousValue)) {
112
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
113
if
(is_null($data)) {
114
return
null
;
115
}
116
$className =
ChangeValueChangeValueModel::resolveDiscriminatorClass
($data);
117
$this->previousValue = $className::of($data);
118
}
119
120
return
$this->previousValue
;
121
}
122
129
public
function
getNextValue
()
130
{
131
if
(is_null($this->nextValue)) {
133
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
134
if
(is_null($data)) {
135
return
null
;
136
}
137
$className =
ChangeValueChangeValueModel::resolveDiscriminatorClass
($data);
138
$this->nextValue = $className::of($data);
139
}
140
141
return
$this->nextValue
;
142
}
143
144
148
public
function
setChange
(?
string
$change
): void
149
{
150
$this->change =
$change
;
151
}
152
156
public
function
setPreviousValue
(?
ChangeValueChangeValue
$previousValue
): void
157
{
158
$this->previousValue =
$previousValue
;
159
}
160
164
public
function
setNextValue
(?
ChangeValueChangeValue
$nextValue
): void
165
{
166
$this->nextValue =
$nextValue
;
167
}
168
169
170
171
}
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\History\Models\Change\ChangeValueChangeModel
Definition
ChangeValueChangeModel.php:23
Commercetools\History\Models\Change\ChangeValueChangeModel\getNextValue
getNextValue()
Definition
ChangeValueChangeModel.php:129
Commercetools\History\Models\Change\ChangeValueChangeModel\$change
$change
Definition
ChangeValueChangeModel.php:36
Commercetools\History\Models\Change\ChangeValueChangeModel\$type
$type
Definition
ChangeValueChangeModel.php:30
Commercetools\History\Models\Change\ChangeValueChangeModel\setNextValue
setNextValue(?ChangeValueChangeValue $nextValue)
Definition
ChangeValueChangeModel.php:164
Commercetools\History\Models\Change\ChangeValueChangeModel\__construct
__construct(?string $change=null, ?ChangeValueChangeValue $previousValue=null, ?ChangeValueChangeValue $nextValue=null, ?string $type=null)
Definition
ChangeValueChangeModel.php:54
Commercetools\History\Models\Change\ChangeValueChangeModel\setPreviousValue
setPreviousValue(?ChangeValueChangeValue $previousValue)
Definition
ChangeValueChangeModel.php:156
Commercetools\History\Models\Change\ChangeValueChangeModel\getType
getType()
Definition
ChangeValueChangeModel.php:70
Commercetools\History\Models\Change\ChangeValueChangeModel\setChange
setChange(?string $change)
Definition
ChangeValueChangeModel.php:148
Commercetools\History\Models\Change\ChangeValueChangeModel\getPreviousValue
getPreviousValue()
Definition
ChangeValueChangeModel.php:108
Commercetools\History\Models\Change\ChangeValueChangeModel\$nextValue
$nextValue
Definition
ChangeValueChangeModel.php:48
Commercetools\History\Models\Change\ChangeValueChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
ChangeValueChangeModel.php:25
Commercetools\History\Models\Change\ChangeValueChangeModel\$previousValue
$previousValue
Definition
ChangeValueChangeModel.php:42
Commercetools\History\Models\Change\ChangeValueChangeModel\getChange
getChange()
Definition
ChangeValueChangeModel.php:88
Commercetools\History\Models\ChangeValue\ChangeValueChangeValueModel
Definition
ChangeValueChangeValueModel.php:21
Commercetools\History\Models\ChangeValue\ChangeValueChangeValueModel\resolveDiscriminatorClass
static resolveDiscriminatorClass($value)
Definition
ChangeValueChangeValueModel.php:77
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\ChangeValueChange
Definition
ChangeValueChange.php:16
Commercetools\History\Models\ChangeValue\ChangeValueChangeValue
Definition
ChangeValueChangeValue.php:15
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8