commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Cart
TaxPortionDraftBuilder.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\MoneyBuilder
;
13
use
Commercetools\Base\Builder
;
14
use
Commercetools\Base\DateTimeImmutableCollection
;
15
use
Commercetools\Base\JsonObject
;
16
use
Commercetools\Base\JsonObjectModel
;
17
use
Commercetools\Base\MapperFactory
;
18
use stdClass;
19
23
final
class
TaxPortionDraftBuilder
implements
Builder
24
{
29
private
$name;
30
35
private
$rate;
36
41
private
$amount;
42
49
public
function
getName
()
50
{
51
return
$this->name;
52
}
53
60
public
function
getRate
()
61
{
62
return
$this->rate;
63
}
64
71
public
function
getAmount
()
72
{
73
return
$this->amount instanceof
MoneyBuilder
? $this->amount->
build
() : $this->amount;
74
}
75
80
public
function
withName
(?
string
$name)
81
{
82
$this->name = $name;
83
84
return
$this;
85
}
86
91
public
function
withRate
(?
float
$rate)
92
{
93
$this->rate = $rate;
94
95
return
$this;
96
}
97
102
public
function
withAmount
(?
Money
$amount)
103
{
104
$this->amount = $amount;
105
106
return
$this;
107
}
108
113
public
function
withAmountBuilder
(?
MoneyBuilder
$amount)
114
{
115
$this->amount = $amount;
116
117
return
$this;
118
}
119
120
public
function
build
():
TaxPortionDraft
121
{
122
return
new
TaxPortionDraftModel
(
123
$this->name,
124
$this->rate,
125
$this->amount instanceof
MoneyBuilder
? $this->amount->
build
() : $this->amount
126
);
127
}
128
129
public
static
function
of
():
TaxPortionDraftBuilder
130
{
131
return
new
self
();
132
}
133
}
Commercetools\Api\Models\Cart\TaxPortionDraftBuilder
Definition:
TaxPortionDraftBuilder.php:24
Commercetools\Api\Models\Cart\TaxPortionDraftBuilder\getName
getName()
Definition:
TaxPortionDraftBuilder.php:49
Commercetools\Api\Models\Cart\TaxPortionDraftBuilder\getRate
getRate()
Definition:
TaxPortionDraftBuilder.php:60
Commercetools\Api\Models\Cart\TaxPortionDraftBuilder\getAmount
getAmount()
Definition:
TaxPortionDraftBuilder.php:71
Commercetools\Api\Models\Cart\TaxPortionDraftBuilder\withName
withName(?string $name)
Definition:
TaxPortionDraftBuilder.php:80
Commercetools\Api\Models\Cart\TaxPortionDraftBuilder\withAmountBuilder
withAmountBuilder(?MoneyBuilder $amount)
Definition:
TaxPortionDraftBuilder.php:113
Commercetools\Api\Models\Cart\TaxPortionDraftBuilder\withRate
withRate(?float $rate)
Definition:
TaxPortionDraftBuilder.php:91
Commercetools\Api\Models\Cart\TaxPortionDraftBuilder\of
static of()
Definition:
TaxPortionDraftBuilder.php:129
Commercetools\Api\Models\Cart\TaxPortionDraftBuilder\withAmount
withAmount(?Money $amount)
Definition:
TaxPortionDraftBuilder.php:102
Commercetools\Api\Models\Cart\TaxPortionDraftBuilder\build
build()
Definition:
TaxPortionDraftBuilder.php:120
Commercetools\Api\Models\Cart\TaxPortionDraftModel
Definition:
TaxPortionDraftModel.php:23
Commercetools\Api\Models\Common\MoneyBuilder
Definition:
MoneyBuilder.php:22
Commercetools\Api\Models\Common\MoneyBuilder\build
build()
Definition:
MoneyBuilder.php:84
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\Builder
Definition:
Builder.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Cart
Definition:
Cart.php:9
Generated by
1.9.1