commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
CartDiscount
CartDiscountValueAbsoluteModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\CartDiscount
;
10
11
use
Commercetools\Api\Models\Common\CentPrecisionMoneyCollection
;
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
CartDiscountValueAbsoluteModel
extends
JsonObjectModel
implements
CartDiscountValueAbsolute
22
{
23
public
const
DISCRIMINATOR_VALUE
=
'absolute'
;
28
protected
$type
;
29
34
protected
$money
;
35
40
protected
$applicationMode
;
41
42
46
public
function
__construct
(
47
?
CentPrecisionMoneyCollection
$money
=
null
,
48
?
string
$applicationMode
=
null
,
49
?
string
$type
=
null
50
) {
51
$this->money =
$money
;
52
$this->applicationMode =
$applicationMode
;
53
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
54
}
55
60
public
function
getType
()
61
{
62
if
(is_null($this->type)) {
64
$data = $this->
raw
(self::FIELD_TYPE);
65
if
(is_null($data)) {
66
return
null
;
67
}
68
$this->type = (string) $data;
69
}
70
71
return
$this->type
;
72
}
73
80
public
function
getMoney
()
81
{
82
if
(is_null($this->money)) {
84
$data = $this->
raw
(self::FIELD_MONEY);
85
if
(is_null($data)) {
86
return
null
;
87
}
88
$this->money =
CentPrecisionMoneyCollection::fromArray
($data);
89
}
90
91
return
$this->money
;
92
}
93
100
public
function
getApplicationMode
()
101
{
102
if
(is_null($this->applicationMode)) {
104
$data = $this->
raw
(self::FIELD_APPLICATION_MODE);
105
if
(is_null($data)) {
106
return
null
;
107
}
108
$this->applicationMode = (string) $data;
109
}
110
111
return
$this->applicationMode
;
112
}
113
114
118
public
function
setMoney
(?
CentPrecisionMoneyCollection
$money
): void
119
{
120
$this->money =
$money
;
121
}
122
126
public
function
setApplicationMode
(?
string
$applicationMode
): void
127
{
128
$this->applicationMode =
$applicationMode
;
129
}
130
}
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteModel
Definition:
CartDiscountValueAbsoluteModel.php:22
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteModel\getApplicationMode
getApplicationMode()
Definition:
CartDiscountValueAbsoluteModel.php:100
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteModel\setMoney
setMoney(?CentPrecisionMoneyCollection $money)
Definition:
CartDiscountValueAbsoluteModel.php:118
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteModel\$applicationMode
$applicationMode
Definition:
CartDiscountValueAbsoluteModel.php:40
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteModel\$money
$money
Definition:
CartDiscountValueAbsoluteModel.php:34
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
CartDiscountValueAbsoluteModel.php:23
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteModel\getMoney
getMoney()
Definition:
CartDiscountValueAbsoluteModel.php:80
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteModel\getType
getType()
Definition:
CartDiscountValueAbsoluteModel.php:60
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteModel\$type
$type
Definition:
CartDiscountValueAbsoluteModel.php:28
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteModel\setApplicationMode
setApplicationMode(?string $applicationMode)
Definition:
CartDiscountValueAbsoluteModel.php:126
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteModel\__construct
__construct(?CentPrecisionMoneyCollection $money=null, ?string $applicationMode=null, ?string $type=null)
Definition:
CartDiscountValueAbsoluteModel.php:46
Commercetools\Api\Models\Common\CentPrecisionMoneyCollection
Definition:
CentPrecisionMoneyCollection.php:22
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\CartDiscountValueAbsolute
Definition:
CartDiscountValueAbsolute.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\CartDiscount
Definition:
CartDiscount.php:9
Generated by
1.9.1