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
StandalonePriceChangeValueChangeModel.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\Money
;
17
use
Commercetools\History\Models\Common\MoneyModel
;
18
22
final
class
StandalonePriceChangeValueChangeModel
extends
JsonObjectModel
implements
StandalonePriceChangeValueChange
23
{
24
25
public
const
DISCRIMINATOR_VALUE
=
'StandalonePriceChangeValueChange'
;
30
protected
$type
;
31
36
protected
$change
;
37
42
protected
$staged
;
43
48
protected
$previousValue
;
49
54
protected
$nextValue
;
55
56
60
public
function
__construct
(
61
?
string
$change
=
null
,
62
?
bool
$staged
=
null
,
63
?
Money
$previousValue
=
null
,
64
?
Money
$nextValue
=
null
,
65
?
string
$type
=
null
66
) {
67
$this->change =
$change
;
68
$this->staged =
$staged
;
69
$this->previousValue =
$previousValue
;
70
$this->nextValue =
$nextValue
;
71
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
72
}
73
78
public
function
getType
()
79
{
80
if
(is_null($this->type)) {
82
$data = $this->
raw
(self::FIELD_TYPE);
83
if
(is_null($data)) {
84
return
null
;
85
}
86
$this->type = (string) $data;
87
}
88
89
return
$this->type
;
90
}
91
96
public
function
getChange
()
97
{
98
if
(is_null($this->change)) {
100
$data = $this->
raw
(self::FIELD_CHANGE);
101
if
(is_null($data)) {
102
return
null
;
103
}
104
$this->change = (string) $data;
105
}
106
107
return
$this->change
;
108
}
109
116
public
function
getStaged
()
117
{
118
if
(is_null($this->staged)) {
120
$data = $this->
raw
(self::FIELD_STAGED);
121
if
(is_null($data)) {
122
return
null
;
123
}
124
$this->staged = (bool) $data;
125
}
126
127
return
$this->staged
;
128
}
129
136
public
function
getPreviousValue
()
137
{
138
if
(is_null($this->previousValue)) {
140
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
141
if
(is_null($data)) {
142
return
null
;
143
}
144
145
$this->previousValue = MoneyModel::of($data);
146
}
147
148
return
$this->previousValue
;
149
}
150
157
public
function
getNextValue
()
158
{
159
if
(is_null($this->nextValue)) {
161
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
162
if
(is_null($data)) {
163
return
null
;
164
}
165
166
$this->nextValue = MoneyModel::of($data);
167
}
168
169
return
$this->nextValue
;
170
}
171
172
176
public
function
setChange
(?
string
$change
): void
177
{
178
$this->change =
$change
;
179
}
180
184
public
function
setStaged
(?
bool
$staged
): void
185
{
186
$this->staged =
$staged
;
187
}
188
192
public
function
setPreviousValue
(?
Money
$previousValue
): void
193
{
194
$this->previousValue =
$previousValue
;
195
}
196
200
public
function
setNextValue
(?
Money
$nextValue
): void
201
{
202
$this->nextValue =
$nextValue
;
203
}
204
205
206
207
}
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\StandalonePriceChangeValueChangeModel
Definition
StandalonePriceChangeValueChangeModel.php:23
Commercetools\History\Models\Change\StandalonePriceChangeValueChangeModel\setNextValue
setNextValue(?Money $nextValue)
Definition
StandalonePriceChangeValueChangeModel.php:200
Commercetools\History\Models\Change\StandalonePriceChangeValueChangeModel\$previousValue
$previousValue
Definition
StandalonePriceChangeValueChangeModel.php:48
Commercetools\History\Models\Change\StandalonePriceChangeValueChangeModel\setPreviousValue
setPreviousValue(?Money $previousValue)
Definition
StandalonePriceChangeValueChangeModel.php:192
Commercetools\History\Models\Change\StandalonePriceChangeValueChangeModel\getChange
getChange()
Definition
StandalonePriceChangeValueChangeModel.php:96
Commercetools\History\Models\Change\StandalonePriceChangeValueChangeModel\getType
getType()
Definition
StandalonePriceChangeValueChangeModel.php:78
Commercetools\History\Models\Change\StandalonePriceChangeValueChangeModel\getPreviousValue
getPreviousValue()
Definition
StandalonePriceChangeValueChangeModel.php:136
Commercetools\History\Models\Change\StandalonePriceChangeValueChangeModel\setChange
setChange(?string $change)
Definition
StandalonePriceChangeValueChangeModel.php:176
Commercetools\History\Models\Change\StandalonePriceChangeValueChangeModel\$nextValue
$nextValue
Definition
StandalonePriceChangeValueChangeModel.php:54
Commercetools\History\Models\Change\StandalonePriceChangeValueChangeModel\$change
$change
Definition
StandalonePriceChangeValueChangeModel.php:36
Commercetools\History\Models\Change\StandalonePriceChangeValueChangeModel\getNextValue
getNextValue()
Definition
StandalonePriceChangeValueChangeModel.php:157
Commercetools\History\Models\Change\StandalonePriceChangeValueChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
StandalonePriceChangeValueChangeModel.php:25
Commercetools\History\Models\Change\StandalonePriceChangeValueChangeModel\__construct
__construct(?string $change=null, ?bool $staged=null, ?Money $previousValue=null, ?Money $nextValue=null, ?string $type=null)
Definition
StandalonePriceChangeValueChangeModel.php:60
Commercetools\History\Models\Change\StandalonePriceChangeValueChangeModel\getStaged
getStaged()
Definition
StandalonePriceChangeValueChangeModel.php:116
Commercetools\History\Models\Change\StandalonePriceChangeValueChangeModel\$staged
$staged
Definition
StandalonePriceChangeValueChangeModel.php:42
Commercetools\History\Models\Change\StandalonePriceChangeValueChangeModel\setStaged
setStaged(?bool $staged)
Definition
StandalonePriceChangeValueChangeModel.php:184
Commercetools\History\Models\Change\StandalonePriceChangeValueChangeModel\$type
$type
Definition
StandalonePriceChangeValueChangeModel.php:30
Commercetools\History\Models\Common\MoneyModel
Definition
MoneyModel.php:21
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\StandalonePriceChangeValueChange
Definition
StandalonePriceChangeValueChange.php:16
Commercetools\History\Models\Common\Money
Definition
Money.php:15
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8