commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
CartDiscount
CartDiscountValueFixedModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\CartDiscount
;
10
11
use
Commercetools\Api\Models\Common\TypedMoneyCollection
;
12
use
Commercetools\Base\DateTimeImmutableCollection
;
13
use
Commercetools\Base\JsonObject
;
14
use
Commercetools\Base\JsonObjectModel
;
15
use
Commercetools\Base\MapperFactory
;
16
use stdClass;
17
21
final
class
CartDiscountValueFixedModel
extends
JsonObjectModel
implements
CartDiscountValueFixed
22
{
23
public
const
DISCRIMINATOR_VALUE
=
'fixed'
;
28
protected
$type
;
29
34
protected
$money
;
35
36
40
public
function
__construct
(
41
?
TypedMoneyCollection
$money
=
null
,
42
?
string
$type
=
null
43
) {
44
$this->money =
$money
;
45
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
46
}
47
52
public
function
getType
()
53
{
54
if
(is_null($this->type)) {
56
$data = $this->
raw
(self::FIELD_TYPE);
57
if
(is_null($data)) {
58
return
null
;
59
}
60
$this->type = (string) $data;
61
}
62
63
return
$this->type
;
64
}
65
72
public
function
getMoney
()
73
{
74
if
(is_null($this->money)) {
76
$data = $this->
raw
(self::FIELD_MONEY);
77
if
(is_null($data)) {
78
return
null
;
79
}
80
$this->money =
TypedMoneyCollection::fromArray
($data);
81
}
82
83
return
$this->money
;
84
}
85
86
90
public
function
setMoney
(?
TypedMoneyCollection
$money
): void
91
{
92
$this->money =
$money
;
93
}
94
}
Commercetools\Api\Models\CartDiscount\CartDiscountValueFixedModel
Definition:
CartDiscountValueFixedModel.php:22
Commercetools\Api\Models\CartDiscount\CartDiscountValueFixedModel\getType
getType()
Definition:
CartDiscountValueFixedModel.php:52
Commercetools\Api\Models\CartDiscount\CartDiscountValueFixedModel\getMoney
getMoney()
Definition:
CartDiscountValueFixedModel.php:72
Commercetools\Api\Models\CartDiscount\CartDiscountValueFixedModel\setMoney
setMoney(?TypedMoneyCollection $money)
Definition:
CartDiscountValueFixedModel.php:90
Commercetools\Api\Models\CartDiscount\CartDiscountValueFixedModel\__construct
__construct(?TypedMoneyCollection $money=null, ?string $type=null)
Definition:
CartDiscountValueFixedModel.php:40
Commercetools\Api\Models\CartDiscount\CartDiscountValueFixedModel\$money
$money
Definition:
CartDiscountValueFixedModel.php:34
Commercetools\Api\Models\CartDiscount\CartDiscountValueFixedModel\$type
$type
Definition:
CartDiscountValueFixedModel.php:28
Commercetools\Api\Models\CartDiscount\CartDiscountValueFixedModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
CartDiscountValueFixedModel.php:23
Commercetools\Api\Models\Common\TypedMoneyCollection
Definition:
TypedMoneyCollection.php:26
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\Api\Models\CartDiscount\CartDiscountValueFixed
Definition:
CartDiscountValueFixed.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\CartDiscount
Definition:
CartDiscount.php:9
Generated by
1.9.1