commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
CartDiscount
CartDiscountValueAbsoluteDraftModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\CartDiscount
;
10
11
use
Commercetools\Api\Models\Common\MoneyCollection
;
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
CartDiscountValueAbsoluteDraftModel
extends
JsonObjectModel
implements
CartDiscountValueAbsoluteDraft
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
?
MoneyCollection
$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
82
public
function
getMoney
()
83
{
84
if
(is_null($this->money)) {
86
$data = $this->
raw
(self::FIELD_MONEY);
87
if
(is_null($data)) {
88
return
null
;
89
}
90
$this->money =
MoneyCollection::fromArray
($data);
91
}
92
93
return
$this->money
;
94
}
95
103
public
function
getApplicationMode
()
104
{
105
if
(is_null($this->applicationMode)) {
107
$data = $this->
raw
(self::FIELD_APPLICATION_MODE);
108
if
(is_null($data)) {
109
return
null
;
110
}
111
$this->applicationMode = (string) $data;
112
}
113
114
return
$this->applicationMode
;
115
}
116
117
121
public
function
setMoney
(?
MoneyCollection
$money
): void
122
{
123
$this->money =
$money
;
124
}
125
129
public
function
setApplicationMode
(?
string
$applicationMode
): void
130
{
131
$this->applicationMode =
$applicationMode
;
132
}
133
}
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteDraftModel
Definition:
CartDiscountValueAbsoluteDraftModel.php:22
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteDraftModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
CartDiscountValueAbsoluteDraftModel.php:23
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteDraftModel\setApplicationMode
setApplicationMode(?string $applicationMode)
Definition:
CartDiscountValueAbsoluteDraftModel.php:129
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteDraftModel\getMoney
getMoney()
Definition:
CartDiscountValueAbsoluteDraftModel.php:82
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteDraftModel\__construct
__construct(?MoneyCollection $money=null, ?string $applicationMode=null, ?string $type=null)
Definition:
CartDiscountValueAbsoluteDraftModel.php:46
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteDraftModel\$money
$money
Definition:
CartDiscountValueAbsoluteDraftModel.php:34
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteDraftModel\$applicationMode
$applicationMode
Definition:
CartDiscountValueAbsoluteDraftModel.php:40
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteDraftModel\setMoney
setMoney(?MoneyCollection $money)
Definition:
CartDiscountValueAbsoluteDraftModel.php:121
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteDraftModel\$type
$type
Definition:
CartDiscountValueAbsoluteDraftModel.php:28
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteDraftModel\getApplicationMode
getApplicationMode()
Definition:
CartDiscountValueAbsoluteDraftModel.php:103
Commercetools\Api\Models\CartDiscount\CartDiscountValueAbsoluteDraftModel\getType
getType()
Definition:
CartDiscountValueAbsoluteDraftModel.php:60
Commercetools\Api\Models\Common\MoneyCollection
Definition:
MoneyCollection.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\CartDiscountValueAbsoluteDraft
Definition:
CartDiscountValueAbsoluteDraft.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\CartDiscount
Definition:
CartDiscount.php:9
Generated by
1.9.1