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
CartRemoveLineItemActionBuilder.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
CartRemoveLineItemActionBuilder
implements
Builder
24
{
29
private
$lineItemId;
30
35
private
$lineItemKey;
36
41
private
$quantity;
42
47
private
$externalPrice;
48
53
private
$externalTotalPrice;
54
59
private
$shippingDetailsToRemove;
60
67
public
function
getLineItemId
()
68
{
69
return
$this->lineItemId;
70
}
71
78
public
function
getLineItemKey
()
79
{
80
return
$this->lineItemKey;
81
}
82
90
public
function
getQuantity
()
91
{
92
return
$this->quantity;
93
}
94
101
public
function
getExternalPrice
()
102
{
103
return
$this->externalPrice instanceof
MoneyBuilder
? $this->externalPrice->
build
() : $this->externalPrice;
104
}
105
112
public
function
getExternalTotalPrice
()
113
{
114
return
$this->externalTotalPrice instanceof
ExternalLineItemTotalPriceBuilder
? $this->externalTotalPrice->
build
() : $this->externalTotalPrice;
115
}
116
123
public
function
getShippingDetailsToRemove
()
124
{
125
return
$this->shippingDetailsToRemove instanceof
ItemShippingDetailsDraftBuilder
? $this->shippingDetailsToRemove->
build
() : $this->shippingDetailsToRemove;
126
}
127
132
public
function
withLineItemId
(?
string
$lineItemId)
133
{
134
$this->lineItemId = $lineItemId;
135
136
return
$this;
137
}
138
143
public
function
withLineItemKey
(?
string
$lineItemKey)
144
{
145
$this->lineItemKey = $lineItemKey;
146
147
return
$this;
148
}
149
154
public
function
withQuantity
(?
int
$quantity)
155
{
156
$this->quantity = $quantity;
157
158
return
$this;
159
}
160
165
public
function
withExternalPrice
(?
Money
$externalPrice)
166
{
167
$this->externalPrice = $externalPrice;
168
169
return
$this;
170
}
171
176
public
function
withExternalTotalPrice
(?
ExternalLineItemTotalPrice
$externalTotalPrice)
177
{
178
$this->externalTotalPrice = $externalTotalPrice;
179
180
return
$this;
181
}
182
187
public
function
withShippingDetailsToRemove
(?
ItemShippingDetailsDraft
$shippingDetailsToRemove)
188
{
189
$this->shippingDetailsToRemove = $shippingDetailsToRemove;
190
191
return
$this;
192
}
193
198
public
function
withExternalPriceBuilder
(?
MoneyBuilder
$externalPrice)
199
{
200
$this->externalPrice = $externalPrice;
201
202
return
$this;
203
}
204
209
public
function
withExternalTotalPriceBuilder
(?
ExternalLineItemTotalPriceBuilder
$externalTotalPrice)
210
{
211
$this->externalTotalPrice = $externalTotalPrice;
212
213
return
$this;
214
}
215
220
public
function
withShippingDetailsToRemoveBuilder
(?
ItemShippingDetailsDraftBuilder
$shippingDetailsToRemove)
221
{
222
$this->shippingDetailsToRemove = $shippingDetailsToRemove;
223
224
return
$this;
225
}
226
227
public
function
build
():
CartRemoveLineItemAction
228
{
229
return
new
CartRemoveLineItemActionModel
(
230
$this->lineItemId,
231
$this->lineItemKey,
232
$this->quantity,
233
$this->externalPrice instanceof
MoneyBuilder
? $this->externalPrice->
build
() : $this->externalPrice,
234
$this->externalTotalPrice instanceof
ExternalLineItemTotalPriceBuilder
? $this->externalTotalPrice->
build
() : $this->externalTotalPrice,
235
$this->shippingDetailsToRemove instanceof
ItemShippingDetailsDraftBuilder
? $this->shippingDetailsToRemove->
build
() : $this->shippingDetailsToRemove
236
);
237
}
238
239
public
static
function
of
():
CartRemoveLineItemActionBuilder
240
{
241
return
new
self
();
242
}
243
}
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder
Definition
CartRemoveLineItemActionBuilder.php:24
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\withShippingDetailsToRemoveBuilder
withShippingDetailsToRemoveBuilder(?ItemShippingDetailsDraftBuilder $shippingDetailsToRemove)
Definition
CartRemoveLineItemActionBuilder.php:220
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\of
static of()
Definition
CartRemoveLineItemActionBuilder.php:239
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\withExternalTotalPriceBuilder
withExternalTotalPriceBuilder(?ExternalLineItemTotalPriceBuilder $externalTotalPrice)
Definition
CartRemoveLineItemActionBuilder.php:209
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\getExternalTotalPrice
getExternalTotalPrice()
Definition
CartRemoveLineItemActionBuilder.php:112
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\withLineItemId
withLineItemId(?string $lineItemId)
Definition
CartRemoveLineItemActionBuilder.php:132
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\withLineItemKey
withLineItemKey(?string $lineItemKey)
Definition
CartRemoveLineItemActionBuilder.php:143
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\build
build()
Definition
CartRemoveLineItemActionBuilder.php:227
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\getQuantity
getQuantity()
Definition
CartRemoveLineItemActionBuilder.php:90
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\getLineItemId
getLineItemId()
Definition
CartRemoveLineItemActionBuilder.php:67
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\withExternalPrice
withExternalPrice(?Money $externalPrice)
Definition
CartRemoveLineItemActionBuilder.php:165
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\withExternalPriceBuilder
withExternalPriceBuilder(?MoneyBuilder $externalPrice)
Definition
CartRemoveLineItemActionBuilder.php:198
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\getExternalPrice
getExternalPrice()
Definition
CartRemoveLineItemActionBuilder.php:101
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\withExternalTotalPrice
withExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice)
Definition
CartRemoveLineItemActionBuilder.php:176
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\getLineItemKey
getLineItemKey()
Definition
CartRemoveLineItemActionBuilder.php:78
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\withQuantity
withQuantity(?int $quantity)
Definition
CartRemoveLineItemActionBuilder.php:154
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\getShippingDetailsToRemove
getShippingDetailsToRemove()
Definition
CartRemoveLineItemActionBuilder.php:123
Commercetools\Api\Models\Cart\CartRemoveLineItemActionBuilder\withShippingDetailsToRemove
withShippingDetailsToRemove(?ItemShippingDetailsDraft $shippingDetailsToRemove)
Definition
CartRemoveLineItemActionBuilder.php:187
Commercetools\Api\Models\Cart\CartRemoveLineItemActionModel
Definition
CartRemoveLineItemActionModel.php:23
Commercetools\Api\Models\Cart\ExternalLineItemTotalPriceBuilder
Definition
ExternalLineItemTotalPriceBuilder.php:24
Commercetools\Api\Models\Cart\ExternalLineItemTotalPriceBuilder\build
build()
Definition
ExternalLineItemTotalPriceBuilder.php:103
Commercetools\Api\Models\Cart\ItemShippingDetailsDraftBuilder
Definition
ItemShippingDetailsDraftBuilder.php:22
Commercetools\Api\Models\Cart\ItemShippingDetailsDraftBuilder\build
build()
Definition
ItemShippingDetailsDraftBuilder.php:53
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\CartRemoveLineItemAction
Definition
CartRemoveLineItemAction.php:16
Commercetools\Api\Models\Cart\ExternalLineItemTotalPrice
Definition
ExternalLineItemTotalPrice.php:16
Commercetools\Api\Models\Cart\ItemShippingDetailsDraft
Definition
ItemShippingDetailsDraft.php:15
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.8