commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
Cart
TaxedPriceDraftBuilder.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\Api\Models\Common\TypedMoneyDraft
;
14
use
Commercetools\Api\Models\Common\TypedMoneyDraftBuilder
;
15
use
Commercetools\Base\Builder
;
16
use
Commercetools\Base\DateTimeImmutableCollection
;
17
use
Commercetools\Base\JsonObject
;
18
use
Commercetools\Base\JsonObjectModel
;
19
use
Commercetools\Base\MapperFactory
;
20
use stdClass;
21
25
final
class
TaxedPriceDraftBuilder
implements
Builder
26
{
31
private
$totalNet;
32
37
private
$totalGross;
38
43
private
$taxPortions;
44
49
private
$totalTax;
50
57
public
function
getTotalNet
()
58
{
59
return
$this->totalNet instanceof
MoneyBuilder
? $this->totalNet->
build
() : $this->totalNet;
60
}
61
68
public
function
getTotalGross
()
69
{
70
return
$this->totalGross instanceof
MoneyBuilder
? $this->totalGross->
build
() : $this->totalGross;
71
}
72
80
public
function
getTaxPortions
()
81
{
82
return
$this->taxPortions;
83
}
84
91
public
function
getTotalTax
()
92
{
93
return
$this->totalTax instanceof
TypedMoneyDraftBuilder
? $this->totalTax->
build
() : $this->totalTax;
94
}
95
100
public
function
withTotalNet
(?
Money
$totalNet)
101
{
102
$this->totalNet = $totalNet;
103
104
return
$this;
105
}
106
111
public
function
withTotalGross
(?
Money
$totalGross)
112
{
113
$this->totalGross = $totalGross;
114
115
return
$this;
116
}
117
122
public
function
withTaxPortions
(?
TaxPortionDraftCollection
$taxPortions)
123
{
124
$this->taxPortions = $taxPortions;
125
126
return
$this;
127
}
128
133
public
function
withTotalTax
(?
TypedMoneyDraft
$totalTax)
134
{
135
$this->totalTax = $totalTax;
136
137
return
$this;
138
}
139
144
public
function
withTotalNetBuilder
(?
MoneyBuilder
$totalNet)
145
{
146
$this->totalNet = $totalNet;
147
148
return
$this;
149
}
150
155
public
function
withTotalGrossBuilder
(?
MoneyBuilder
$totalGross)
156
{
157
$this->totalGross = $totalGross;
158
159
return
$this;
160
}
161
166
public
function
withTotalTaxBuilder
(?
TypedMoneyDraftBuilder
$totalTax)
167
{
168
$this->totalTax = $totalTax;
169
170
return
$this;
171
}
172
173
public
function
build
():
TaxedPriceDraft
174
{
175
return
new
TaxedPriceDraftModel
(
176
$this->totalNet instanceof
MoneyBuilder
? $this->totalNet->
build
() : $this->totalNet,
177
$this->totalGross instanceof
MoneyBuilder
? $this->totalGross->
build
() : $this->totalGross,
178
$this->taxPortions,
179
$this->totalTax instanceof
TypedMoneyDraftBuilder
? $this->totalTax->
build
() : $this->totalTax
180
);
181
}
182
183
public
static
function
of
():
TaxedPriceDraftBuilder
184
{
185
return
new
self
();
186
}
187
}
Commercetools\Api\Models\Cart\TaxPortionDraftCollection
Definition
TaxPortionDraftCollection.php:22
Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder
Definition
TaxedPriceDraftBuilder.php:26
Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder\withTaxPortions
withTaxPortions(?TaxPortionDraftCollection $taxPortions)
Definition
TaxedPriceDraftBuilder.php:122
Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder\build
build()
Definition
TaxedPriceDraftBuilder.php:173
Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder\getTotalGross
getTotalGross()
Definition
TaxedPriceDraftBuilder.php:68
Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder\getTaxPortions
getTaxPortions()
Definition
TaxedPriceDraftBuilder.php:80
Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder\withTotalGrossBuilder
withTotalGrossBuilder(?MoneyBuilder $totalGross)
Definition
TaxedPriceDraftBuilder.php:155
Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder\getTotalTax
getTotalTax()
Definition
TaxedPriceDraftBuilder.php:91
Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder\withTotalTax
withTotalTax(?TypedMoneyDraft $totalTax)
Definition
TaxedPriceDraftBuilder.php:133
Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder\withTotalGross
withTotalGross(?Money $totalGross)
Definition
TaxedPriceDraftBuilder.php:111
Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder\getTotalNet
getTotalNet()
Definition
TaxedPriceDraftBuilder.php:57
Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder\of
static of()
Definition
TaxedPriceDraftBuilder.php:183
Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder\withTotalNetBuilder
withTotalNetBuilder(?MoneyBuilder $totalNet)
Definition
TaxedPriceDraftBuilder.php:144
Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder\withTotalNet
withTotalNet(?Money $totalNet)
Definition
TaxedPriceDraftBuilder.php:100
Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder\withTotalTaxBuilder
withTotalTaxBuilder(?TypedMoneyDraftBuilder $totalTax)
Definition
TaxedPriceDraftBuilder.php:166
Commercetools\Api\Models\Cart\TaxedPriceDraftModel
Definition
TaxedPriceDraftModel.php:25
Commercetools\Api\Models\Common\MoneyBuilder
Definition
MoneyBuilder.php:22
Commercetools\Api\Models\Common\MoneyBuilder\build
build()
Definition
MoneyBuilder.php:84
Commercetools\Api\Models\Common\TypedMoneyDraftBuilder
Definition
TypedMoneyDraftBuilder.php:22
Commercetools\Api\Models\Common\TypedMoneyDraftBuilder\build
build()
Definition
TypedMoneyDraftBuilder.php:108
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\TaxedPriceDraft
Definition
TaxedPriceDraft.php:17
Commercetools\Api\Models\Common\Money
Definition
Money.php:15
Commercetools\Api\Models\Common\TypedMoneyDraft
Definition
TypedMoneyDraft.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.8