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
CartAddLineItemActionBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Cart
;
10
11
use
Commercetools\Api\Models\Channel\ChannelResourceIdentifier
;
12
use
Commercetools\Api\Models\Channel\ChannelResourceIdentifierBuilder
;
13
use
Commercetools\Api\Models\Common\Money
;
14
use
Commercetools\Api\Models\Common\MoneyBuilder
;
15
use
Commercetools\Api\Models\Type\CustomFieldsDraft
;
16
use
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
;
17
use
Commercetools\Base\Builder
;
18
use
Commercetools\Base\DateTimeImmutableCollection
;
19
use
Commercetools\Base\JsonObject
;
20
use
Commercetools\Base\JsonObjectModel
;
21
use
Commercetools\Base\MapperFactory
;
22
use DateTimeImmutable;
23
use stdClass;
24
28
final
class
CartAddLineItemActionBuilder
implements
Builder
29
{
34
private
$key;
35
40
private
$productId;
41
46
private
$variantId;
47
52
private
$sku;
53
58
private
$quantity;
59
64
private
$addedAt;
65
70
private
$distributionChannel;
71
76
private
$supplyChannel;
77
82
private
$externalPrice;
83
88
private
$externalTotalPrice;
89
94
private
$externalTaxRate;
95
100
private
$perMethodExternalTaxRate;
101
106
private
$inventoryMode;
107
112
private
$shippingDetails;
113
118
private
$custom;
119
126
public
function
getKey
()
127
{
128
return
$this->key;
129
}
130
138
public
function
getProductId
()
139
{
140
return
$this->productId;
141
}
142
151
public
function
getVariantId
()
152
{
153
return
$this->variantId;
154
}
155
163
public
function
getSku
()
164
{
165
return
$this->sku;
166
}
167
174
public
function
getQuantity
()
175
{
176
return
$this->quantity;
177
}
178
187
public
function
getAddedAt
()
188
{
189
return
$this->addedAt;
190
}
191
200
public
function
getDistributionChannel
()
201
{
202
return
$this->distributionChannel instanceof
ChannelResourceIdentifierBuilder
? $this->distributionChannel->
build
() : $this->distributionChannel;
203
}
204
212
public
function
getSupplyChannel
()
213
{
214
return
$this->supplyChannel instanceof
ChannelResourceIdentifierBuilder
? $this->supplyChannel->
build
() : $this->supplyChannel;
215
}
216
223
public
function
getExternalPrice
()
224
{
225
return
$this->externalPrice instanceof
MoneyBuilder
? $this->externalPrice->
build
() : $this->externalPrice;
226
}
227
234
public
function
getExternalTotalPrice
()
235
{
236
return
$this->externalTotalPrice instanceof
ExternalLineItemTotalPriceBuilder
? $this->externalTotalPrice->
build
() : $this->externalTotalPrice;
237
}
238
245
public
function
getExternalTaxRate
()
246
{
247
return
$this->externalTaxRate instanceof
ExternalTaxRateDraftBuilder
? $this->externalTaxRate->
build
() : $this->externalTaxRate;
248
}
249
256
public
function
getPerMethodExternalTaxRate
()
257
{
258
return
$this->perMethodExternalTaxRate;
259
}
260
268
public
function
getInventoryMode
()
269
{
270
return
$this->inventoryMode;
271
}
272
279
public
function
getShippingDetails
()
280
{
281
return
$this->shippingDetails instanceof
ItemShippingDetailsDraftBuilder
? $this->shippingDetails->
build
() : $this->shippingDetails;
282
}
283
290
public
function
getCustom
()
291
{
292
return
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom;
293
}
294
299
public
function
withKey
(?
string
$key)
300
{
301
$this->key = $key;
302
303
return
$this;
304
}
305
310
public
function
withProductId
(?
string
$productId)
311
{
312
$this->productId = $productId;
313
314
return
$this;
315
}
316
321
public
function
withVariantId
(?
int
$variantId)
322
{
323
$this->variantId = $variantId;
324
325
return
$this;
326
}
327
332
public
function
withSku
(?
string
$sku)
333
{
334
$this->sku = $sku;
335
336
return
$this;
337
}
338
343
public
function
withQuantity
(?
int
$quantity)
344
{
345
$this->quantity = $quantity;
346
347
return
$this;
348
}
349
354
public
function
withAddedAt
(?DateTimeImmutable $addedAt)
355
{
356
$this->addedAt = $addedAt;
357
358
return
$this;
359
}
360
365
public
function
withDistributionChannel
(?
ChannelResourceIdentifier
$distributionChannel)
366
{
367
$this->distributionChannel = $distributionChannel;
368
369
return
$this;
370
}
371
376
public
function
withSupplyChannel
(?
ChannelResourceIdentifier
$supplyChannel)
377
{
378
$this->supplyChannel = $supplyChannel;
379
380
return
$this;
381
}
382
387
public
function
withExternalPrice
(?
Money
$externalPrice)
388
{
389
$this->externalPrice = $externalPrice;
390
391
return
$this;
392
}
393
398
public
function
withExternalTotalPrice
(?
ExternalLineItemTotalPrice
$externalTotalPrice)
399
{
400
$this->externalTotalPrice = $externalTotalPrice;
401
402
return
$this;
403
}
404
409
public
function
withExternalTaxRate
(?
ExternalTaxRateDraft
$externalTaxRate)
410
{
411
$this->externalTaxRate = $externalTaxRate;
412
413
return
$this;
414
}
415
420
public
function
withPerMethodExternalTaxRate
(?
MethodExternalTaxRateDraftCollection
$perMethodExternalTaxRate)
421
{
422
$this->perMethodExternalTaxRate = $perMethodExternalTaxRate;
423
424
return
$this;
425
}
426
431
public
function
withInventoryMode
(?
string
$inventoryMode)
432
{
433
$this->inventoryMode = $inventoryMode;
434
435
return
$this;
436
}
437
442
public
function
withShippingDetails
(?
ItemShippingDetailsDraft
$shippingDetails)
443
{
444
$this->shippingDetails = $shippingDetails;
445
446
return
$this;
447
}
448
453
public
function
withCustom
(?
CustomFieldsDraft
$custom)
454
{
455
$this->custom = $custom;
456
457
return
$this;
458
}
459
464
public
function
withDistributionChannelBuilder
(?
ChannelResourceIdentifierBuilder
$distributionChannel)
465
{
466
$this->distributionChannel = $distributionChannel;
467
468
return
$this;
469
}
470
475
public
function
withSupplyChannelBuilder
(?
ChannelResourceIdentifierBuilder
$supplyChannel)
476
{
477
$this->supplyChannel = $supplyChannel;
478
479
return
$this;
480
}
481
486
public
function
withExternalPriceBuilder
(?
MoneyBuilder
$externalPrice)
487
{
488
$this->externalPrice = $externalPrice;
489
490
return
$this;
491
}
492
497
public
function
withExternalTotalPriceBuilder
(?
ExternalLineItemTotalPriceBuilder
$externalTotalPrice)
498
{
499
$this->externalTotalPrice = $externalTotalPrice;
500
501
return
$this;
502
}
503
508
public
function
withExternalTaxRateBuilder
(?
ExternalTaxRateDraftBuilder
$externalTaxRate)
509
{
510
$this->externalTaxRate = $externalTaxRate;
511
512
return
$this;
513
}
514
519
public
function
withShippingDetailsBuilder
(?
ItemShippingDetailsDraftBuilder
$shippingDetails)
520
{
521
$this->shippingDetails = $shippingDetails;
522
523
return
$this;
524
}
525
530
public
function
withCustomBuilder
(?
CustomFieldsDraftBuilder
$custom)
531
{
532
$this->custom = $custom;
533
534
return
$this;
535
}
536
537
public
function
build
():
CartAddLineItemAction
538
{
539
return
new
CartAddLineItemActionModel
(
540
$this->key,
541
$this->productId,
542
$this->variantId,
543
$this->sku,
544
$this->quantity,
545
$this->addedAt,
546
$this->distributionChannel instanceof
ChannelResourceIdentifierBuilder
? $this->distributionChannel->
build
() : $this->distributionChannel,
547
$this->supplyChannel instanceof
ChannelResourceIdentifierBuilder
? $this->supplyChannel->
build
() : $this->supplyChannel,
548
$this->externalPrice instanceof
MoneyBuilder
? $this->externalPrice->
build
() : $this->externalPrice,
549
$this->externalTotalPrice instanceof
ExternalLineItemTotalPriceBuilder
? $this->externalTotalPrice->
build
() : $this->externalTotalPrice,
550
$this->externalTaxRate instanceof
ExternalTaxRateDraftBuilder
? $this->externalTaxRate->
build
() : $this->externalTaxRate,
551
$this->perMethodExternalTaxRate,
552
$this->inventoryMode,
553
$this->shippingDetails instanceof
ItemShippingDetailsDraftBuilder
? $this->shippingDetails->
build
() : $this->shippingDetails,
554
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom
555
);
556
}
557
558
public
static
function
of
():
CartAddLineItemActionBuilder
559
{
560
return
new
self
();
561
}
562
}
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder
Definition
CartAddLineItemActionBuilder.php:29
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\getExternalTaxRate
getExternalTaxRate()
Definition
CartAddLineItemActionBuilder.php:245
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\getExternalTotalPrice
getExternalTotalPrice()
Definition
CartAddLineItemActionBuilder.php:234
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withKey
withKey(?string $key)
Definition
CartAddLineItemActionBuilder.php:299
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withVariantId
withVariantId(?int $variantId)
Definition
CartAddLineItemActionBuilder.php:321
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withCustom
withCustom(?CustomFieldsDraft $custom)
Definition
CartAddLineItemActionBuilder.php:453
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withQuantity
withQuantity(?int $quantity)
Definition
CartAddLineItemActionBuilder.php:343
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\build
build()
Definition
CartAddLineItemActionBuilder.php:537
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\getKey
getKey()
Definition
CartAddLineItemActionBuilder.php:126
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\getShippingDetails
getShippingDetails()
Definition
CartAddLineItemActionBuilder.php:279
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withExternalTaxRate
withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate)
Definition
CartAddLineItemActionBuilder.php:409
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withSupplyChannel
withSupplyChannel(?ChannelResourceIdentifier $supplyChannel)
Definition
CartAddLineItemActionBuilder.php:376
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withPerMethodExternalTaxRate
withPerMethodExternalTaxRate(?MethodExternalTaxRateDraftCollection $perMethodExternalTaxRate)
Definition
CartAddLineItemActionBuilder.php:420
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withExternalPrice
withExternalPrice(?Money $externalPrice)
Definition
CartAddLineItemActionBuilder.php:387
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withDistributionChannelBuilder
withDistributionChannelBuilder(?ChannelResourceIdentifierBuilder $distributionChannel)
Definition
CartAddLineItemActionBuilder.php:464
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withProductId
withProductId(?string $productId)
Definition
CartAddLineItemActionBuilder.php:310
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\getProductId
getProductId()
Definition
CartAddLineItemActionBuilder.php:138
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\getDistributionChannel
getDistributionChannel()
Definition
CartAddLineItemActionBuilder.php:200
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\getExternalPrice
getExternalPrice()
Definition
CartAddLineItemActionBuilder.php:223
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withExternalTotalPriceBuilder
withExternalTotalPriceBuilder(?ExternalLineItemTotalPriceBuilder $externalTotalPrice)
Definition
CartAddLineItemActionBuilder.php:497
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
Definition
CartAddLineItemActionBuilder.php:530
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\getVariantId
getVariantId()
Definition
CartAddLineItemActionBuilder.php:151
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withExternalTotalPrice
withExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice)
Definition
CartAddLineItemActionBuilder.php:398
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\getCustom
getCustom()
Definition
CartAddLineItemActionBuilder.php:290
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withShippingDetails
withShippingDetails(?ItemShippingDetailsDraft $shippingDetails)
Definition
CartAddLineItemActionBuilder.php:442
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withDistributionChannel
withDistributionChannel(?ChannelResourceIdentifier $distributionChannel)
Definition
CartAddLineItemActionBuilder.php:365
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\of
static of()
Definition
CartAddLineItemActionBuilder.php:558
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\getInventoryMode
getInventoryMode()
Definition
CartAddLineItemActionBuilder.php:268
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\getPerMethodExternalTaxRate
getPerMethodExternalTaxRate()
Definition
CartAddLineItemActionBuilder.php:256
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withExternalTaxRateBuilder
withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate)
Definition
CartAddLineItemActionBuilder.php:508
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withSupplyChannelBuilder
withSupplyChannelBuilder(?ChannelResourceIdentifierBuilder $supplyChannel)
Definition
CartAddLineItemActionBuilder.php:475
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\getAddedAt
getAddedAt()
Definition
CartAddLineItemActionBuilder.php:187
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withSku
withSku(?string $sku)
Definition
CartAddLineItemActionBuilder.php:332
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withInventoryMode
withInventoryMode(?string $inventoryMode)
Definition
CartAddLineItemActionBuilder.php:431
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withShippingDetailsBuilder
withShippingDetailsBuilder(?ItemShippingDetailsDraftBuilder $shippingDetails)
Definition
CartAddLineItemActionBuilder.php:519
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\getQuantity
getQuantity()
Definition
CartAddLineItemActionBuilder.php:174
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\getSku
getSku()
Definition
CartAddLineItemActionBuilder.php:163
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withExternalPriceBuilder
withExternalPriceBuilder(?MoneyBuilder $externalPrice)
Definition
CartAddLineItemActionBuilder.php:486
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\withAddedAt
withAddedAt(?DateTimeImmutable $addedAt)
Definition
CartAddLineItemActionBuilder.php:354
Commercetools\Api\Models\Cart\CartAddLineItemActionBuilder\getSupplyChannel
getSupplyChannel()
Definition
CartAddLineItemActionBuilder.php:212
Commercetools\Api\Models\Cart\CartAddLineItemActionModel
Definition
CartAddLineItemActionModel.php:28
Commercetools\Api\Models\Cart\ExternalLineItemTotalPriceBuilder
Definition
ExternalLineItemTotalPriceBuilder.php:24
Commercetools\Api\Models\Cart\ExternalLineItemTotalPriceBuilder\build
build()
Definition
ExternalLineItemTotalPriceBuilder.php:103
Commercetools\Api\Models\Cart\ExternalTaxRateDraftBuilder
Definition
ExternalTaxRateDraftBuilder.php:23
Commercetools\Api\Models\Cart\ExternalTaxRateDraftBuilder\build
build()
Definition
ExternalTaxRateDraftBuilder.php:201
Commercetools\Api\Models\Cart\ItemShippingDetailsDraftBuilder
Definition
ItemShippingDetailsDraftBuilder.php:22
Commercetools\Api\Models\Cart\ItemShippingDetailsDraftBuilder\build
build()
Definition
ItemShippingDetailsDraftBuilder.php:53
Commercetools\Api\Models\Cart\MethodExternalTaxRateDraftCollection
Definition
MethodExternalTaxRateDraftCollection.php:22
Commercetools\Api\Models\Channel\ChannelResourceIdentifierBuilder
Definition
ChannelResourceIdentifierBuilder.php:24
Commercetools\Api\Models\Channel\ChannelResourceIdentifierBuilder\build
build()
Definition
ChannelResourceIdentifierBuilder.php:82
Commercetools\Api\Models\Common\MoneyBuilder
Definition
MoneyBuilder.php:22
Commercetools\Api\Models\Common\MoneyBuilder\build
build()
Definition
MoneyBuilder.php:84
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
Definition
CustomFieldsDraftBuilder.php:22
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\build
build()
Definition
CustomFieldsDraftBuilder.php:101
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\CartAddLineItemAction
Definition
CartAddLineItemAction.php:19
Commercetools\Api\Models\Cart\ExternalLineItemTotalPrice
Definition
ExternalLineItemTotalPrice.php:16
Commercetools\Api\Models\Cart\ExternalTaxRateDraft
Definition
ExternalTaxRateDraft.php:16
Commercetools\Api\Models\Cart\ItemShippingDetailsDraft
Definition
ItemShippingDetailsDraft.php:15
Commercetools\Api\Models\Channel\ChannelResourceIdentifier
Definition
ChannelResourceIdentifier.php:16
Commercetools\Api\Models\Common\Money
Definition
Money.php:15
Commercetools\Api\Models\Type\CustomFieldsDraft
Definition
CustomFieldsDraft.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