commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-history
src
Models
ChangeValue
ChangeValueAbsoluteChangeValueModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\History\Models\ChangeValue
;
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\MoneyCollection
;
17
21
final
class
ChangeValueAbsoluteChangeValueModel
extends
JsonObjectModel
implements
ChangeValueAbsoluteChangeValue
22
{
23
24
public
const
DISCRIMINATOR_VALUE
=
'absolute'
;
29
protected
$type
;
30
35
protected
$money
;
36
37
41
public
function
__construct
(
42
?
MoneyCollection
$money
=
null
,
43
?
string
$type
=
null
44
) {
45
$this->money =
$money
;
46
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
47
}
48
53
public
function
getType
()
54
{
55
if
(is_null($this->type)) {
57
$data = $this->
raw
(self::FIELD_TYPE);
58
if
(is_null($data)) {
59
return
null
;
60
}
61
$this->type = (string) $data;
62
}
63
64
return
$this->type
;
65
}
66
73
public
function
getMoney
()
74
{
75
if
(is_null($this->money)) {
77
$data = $this->
raw
(self::FIELD_MONEY);
78
if
(is_null($data)) {
79
return
null
;
80
}
81
$this->money =
MoneyCollection::fromArray
($data);
82
}
83
84
return
$this->money
;
85
}
86
87
91
public
function
setMoney
(?
MoneyCollection
$money
): void
92
{
93
$this->money =
$money
;
94
}
95
96
97
98
}
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\Base\MapperSequence\fromArray
static fromArray(array $data)
Definition:
MapperSequence.php:56
Commercetools\History\Models\ChangeValue\ChangeValueAbsoluteChangeValueModel
Definition:
ChangeValueAbsoluteChangeValueModel.php:22
Commercetools\History\Models\ChangeValue\ChangeValueAbsoluteChangeValueModel\getMoney
getMoney()
Definition:
ChangeValueAbsoluteChangeValueModel.php:73
Commercetools\History\Models\ChangeValue\ChangeValueAbsoluteChangeValueModel\getType
getType()
Definition:
ChangeValueAbsoluteChangeValueModel.php:53
Commercetools\History\Models\ChangeValue\ChangeValueAbsoluteChangeValueModel\$money
$money
Definition:
ChangeValueAbsoluteChangeValueModel.php:35
Commercetools\History\Models\ChangeValue\ChangeValueAbsoluteChangeValueModel\setMoney
setMoney(?MoneyCollection $money)
Definition:
ChangeValueAbsoluteChangeValueModel.php:91
Commercetools\History\Models\ChangeValue\ChangeValueAbsoluteChangeValueModel\$type
$type
Definition:
ChangeValueAbsoluteChangeValueModel.php:29
Commercetools\History\Models\ChangeValue\ChangeValueAbsoluteChangeValueModel\__construct
__construct(?MoneyCollection $money=null, ?string $type=null)
Definition:
ChangeValueAbsoluteChangeValueModel.php:41
Commercetools\History\Models\ChangeValue\ChangeValueAbsoluteChangeValueModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
ChangeValueAbsoluteChangeValueModel.php:24
Commercetools\History\Models\Common\MoneyCollection
Definition:
MoneyCollection.php:22
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\History\Models\ChangeValue\ChangeValueAbsoluteChangeValue
Definition:
ChangeValueAbsoluteChangeValue.php:16
Commercetools\History\Models\ChangeValue
Definition:
AssetChangeValue.php:9
Generated by
1.9.1