commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Cart
TaxPortionDraftModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Cart
;
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
TaxPortionDraftModel
extends
JsonObjectModel
implements
TaxPortionDraft
23
{
28
protected
$name
;
29
34
protected
$rate
;
35
40
protected
$amount
;
41
42
46
public
function
__construct
(
47
?
string
$name
=
null
,
48
?
float
$rate
=
null
,
49
?
Money
$amount
=
null
50
) {
51
$this->name =
$name
;
52
$this->rate =
$rate
;
53
$this->amount =
$amount
;
54
}
55
62
public
function
getName
()
63
{
64
if
(is_null($this->name)) {
66
$data = $this->
raw
(self::FIELD_NAME);
67
if
(is_null($data)) {
68
return
null
;
69
}
70
$this->name = (string) $data;
71
}
72
73
return
$this->name
;
74
}
75
82
public
function
getRate
()
83
{
84
if
(is_null($this->rate)) {
86
$data = $this->
raw
(self::FIELD_RATE);
87
if
(is_null($data)) {
88
return
null
;
89
}
90
$this->rate = (float) $data;
91
}
92
93
return
$this->rate
;
94
}
95
102
public
function
getAmount
()
103
{
104
if
(is_null($this->amount)) {
106
$data = $this->
raw
(self::FIELD_AMOUNT);
107
if
(is_null($data)) {
108
return
null
;
109
}
110
111
$this->amount =
MoneyModel::of
($data);
112
}
113
114
return
$this->amount
;
115
}
116
117
121
public
function
setName
(?
string
$name
): void
122
{
123
$this->name =
$name
;
124
}
125
129
public
function
setRate
(?
float
$rate
): void
130
{
131
$this->rate =
$rate
;
132
}
133
137
public
function
setAmount
(?
Money
$amount
): void
138
{
139
$this->amount =
$amount
;
140
}
141
}
Commercetools\Api\Models\Cart\TaxPortionDraftModel
Definition:
TaxPortionDraftModel.php:23
Commercetools\Api\Models\Cart\TaxPortionDraftModel\getAmount
getAmount()
Definition:
TaxPortionDraftModel.php:102
Commercetools\Api\Models\Cart\TaxPortionDraftModel\$name
$name
Definition:
TaxPortionDraftModel.php:28
Commercetools\Api\Models\Cart\TaxPortionDraftModel\getName
getName()
Definition:
TaxPortionDraftModel.php:62
Commercetools\Api\Models\Cart\TaxPortionDraftModel\setRate
setRate(?float $rate)
Definition:
TaxPortionDraftModel.php:129
Commercetools\Api\Models\Cart\TaxPortionDraftModel\setAmount
setAmount(?Money $amount)
Definition:
TaxPortionDraftModel.php:137
Commercetools\Api\Models\Cart\TaxPortionDraftModel\setName
setName(?string $name)
Definition:
TaxPortionDraftModel.php:121
Commercetools\Api\Models\Cart\TaxPortionDraftModel\__construct
__construct(?string $name=null, ?float $rate=null, ?Money $amount=null)
Definition:
TaxPortionDraftModel.php:46
Commercetools\Api\Models\Cart\TaxPortionDraftModel\getRate
getRate()
Definition:
TaxPortionDraftModel.php:82
Commercetools\Api\Models\Cart\TaxPortionDraftModel\$rate
$rate
Definition:
TaxPortionDraftModel.php:34
Commercetools\Api\Models\Cart\TaxPortionDraftModel\$amount
$amount
Definition:
TaxPortionDraftModel.php:40
Commercetools\Api\Models\Common\MoneyModel
Definition:
MoneyModel.php:21
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition:
BaseJsonObject.php:57
Commercetools\Base\BaseJsonObject\of
static of($data=null)
Definition:
BaseJsonObject.php:26
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Api\Models\Cart\TaxPortionDraft
Definition:
TaxPortionDraft.php:16
Commercetools\Api\Models\Common\Money
Definition:
Money.php:15
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Cart
Definition:
Cart.php:9
Generated by
1.9.1