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
StandalonePrice
StandalonePriceChangeValueActionModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\StandalonePrice
;
10
11
use
Commercetools\Api\Models\Common\Money
;
12
use
Commercetools\Api\Models\Common\MoneyModel
;
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
StandalonePriceChangeValueActionModel
extends
JsonObjectModel
implements
StandalonePriceChangeValueAction
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'changeValue'
;
29
protected
$action
;
30
35
protected
$value
;
36
41
protected
$staged
;
42
43
47
public
function
__construct
(
48
?
Money
$value
=
null
,
49
?
bool
$staged
=
null
,
50
?
string
$action
=
null
51
) {
52
$this->value =
$value
;
53
$this->staged =
$staged
;
54
$this->action =
$action
??
self::DISCRIMINATOR_VALUE
;
55
}
56
61
public
function
getAction
()
62
{
63
if
(is_null($this->action)) {
65
$data = $this->
raw
(self::FIELD_ACTION);
66
if
(is_null($data)) {
67
return
null
;
68
}
69
$this->action = (string) $data;
70
}
71
72
return
$this->action
;
73
}
74
82
public
function
getValue
()
83
{
84
if
(is_null($this->value)) {
86
$data = $this->
raw
(self::FIELD_VALUE);
87
if
(is_null($data)) {
88
return
null
;
89
}
90
91
$this->value = MoneyModel::of($data);
92
}
93
94
return
$this->value
;
95
}
96
103
public
function
getStaged
()
104
{
105
if
(is_null($this->staged)) {
107
$data = $this->
raw
(self::FIELD_STAGED);
108
if
(is_null($data)) {
109
return
null
;
110
}
111
$this->staged = (bool) $data;
112
}
113
114
return
$this->staged
;
115
}
116
117
121
public
function
setValue
(?
Money
$value
): void
122
{
123
$this->value =
$value
;
124
}
125
129
public
function
setStaged
(?
bool
$staged
): void
130
{
131
$this->staged =
$staged
;
132
}
133
}
Commercetools\Api\Models\Common\MoneyModel
Definition
MoneyModel.php:21
Commercetools\Api\Models\StandalonePrice\StandalonePriceChangeValueActionModel
Definition
StandalonePriceChangeValueActionModel.php:23
Commercetools\Api\Models\StandalonePrice\StandalonePriceChangeValueActionModel\getValue
getValue()
Definition
StandalonePriceChangeValueActionModel.php:82
Commercetools\Api\Models\StandalonePrice\StandalonePriceChangeValueActionModel\setStaged
setStaged(?bool $staged)
Definition
StandalonePriceChangeValueActionModel.php:129
Commercetools\Api\Models\StandalonePrice\StandalonePriceChangeValueActionModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
StandalonePriceChangeValueActionModel.php:24
Commercetools\Api\Models\StandalonePrice\StandalonePriceChangeValueActionModel\$action
$action
Definition
StandalonePriceChangeValueActionModel.php:29
Commercetools\Api\Models\StandalonePrice\StandalonePriceChangeValueActionModel\$value
$value
Definition
StandalonePriceChangeValueActionModel.php:35
Commercetools\Api\Models\StandalonePrice\StandalonePriceChangeValueActionModel\getStaged
getStaged()
Definition
StandalonePriceChangeValueActionModel.php:103
Commercetools\Api\Models\StandalonePrice\StandalonePriceChangeValueActionModel\getAction
getAction()
Definition
StandalonePriceChangeValueActionModel.php:61
Commercetools\Api\Models\StandalonePrice\StandalonePriceChangeValueActionModel\setValue
setValue(?Money $value)
Definition
StandalonePriceChangeValueActionModel.php:121
Commercetools\Api\Models\StandalonePrice\StandalonePriceChangeValueActionModel\__construct
__construct(?Money $value=null, ?bool $staged=null, ?string $action=null)
Definition
StandalonePriceChangeValueActionModel.php:47
Commercetools\Api\Models\StandalonePrice\StandalonePriceChangeValueActionModel\$staged
$staged
Definition
StandalonePriceChangeValueActionModel.php:41
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\Money
Definition
Money.php:15
Commercetools\Api\Models\StandalonePrice\StandalonePriceChangeValueAction
Definition
StandalonePriceChangeValueAction.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\StandalonePrice
Definition
StagedPriceDraft.php:9
Generated by
1.9.8