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
CartSetShippingMethodActionBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Cart
;
10
11
use
Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifier
;
12
use
Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifierBuilder
;
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
CartSetShippingMethodActionBuilder
implements
Builder
24
{
29
private
$shippingMethod;
30
35
private
$externalTaxRate;
36
45
public
function
getShippingMethod
()
46
{
47
return
$this->shippingMethod instanceof
ShippingMethodResourceIdentifierBuilder
? $this->shippingMethod->
build
() : $this->shippingMethod;
48
}
49
56
public
function
getExternalTaxRate
()
57
{
58
return
$this->externalTaxRate instanceof
ExternalTaxRateDraftBuilder
? $this->externalTaxRate->
build
() : $this->externalTaxRate;
59
}
60
65
public
function
withShippingMethod
(?
ShippingMethodResourceIdentifier
$shippingMethod)
66
{
67
$this->shippingMethod = $shippingMethod;
68
69
return
$this;
70
}
71
76
public
function
withExternalTaxRate
(?
ExternalTaxRateDraft
$externalTaxRate)
77
{
78
$this->externalTaxRate = $externalTaxRate;
79
80
return
$this;
81
}
82
87
public
function
withShippingMethodBuilder
(?
ShippingMethodResourceIdentifierBuilder
$shippingMethod)
88
{
89
$this->shippingMethod = $shippingMethod;
90
91
return
$this;
92
}
93
98
public
function
withExternalTaxRateBuilder
(?
ExternalTaxRateDraftBuilder
$externalTaxRate)
99
{
100
$this->externalTaxRate = $externalTaxRate;
101
102
return
$this;
103
}
104
105
public
function
build
():
CartSetShippingMethodAction
106
{
107
return
new
CartSetShippingMethodActionModel
(
108
$this->shippingMethod instanceof
ShippingMethodResourceIdentifierBuilder
? $this->shippingMethod->
build
() : $this->shippingMethod,
109
$this->externalTaxRate instanceof
ExternalTaxRateDraftBuilder
? $this->externalTaxRate->
build
() : $this->externalTaxRate
110
);
111
}
112
113
public
static
function
of
():
CartSetShippingMethodActionBuilder
114
{
115
return
new
self
();
116
}
117
}
Commercetools\Api\Models\Cart\CartSetShippingMethodActionBuilder
Definition
CartSetShippingMethodActionBuilder.php:24
Commercetools\Api\Models\Cart\CartSetShippingMethodActionBuilder\withShippingMethodBuilder
withShippingMethodBuilder(?ShippingMethodResourceIdentifierBuilder $shippingMethod)
Definition
CartSetShippingMethodActionBuilder.php:87
Commercetools\Api\Models\Cart\CartSetShippingMethodActionBuilder\of
static of()
Definition
CartSetShippingMethodActionBuilder.php:113
Commercetools\Api\Models\Cart\CartSetShippingMethodActionBuilder\getShippingMethod
getShippingMethod()
Definition
CartSetShippingMethodActionBuilder.php:45
Commercetools\Api\Models\Cart\CartSetShippingMethodActionBuilder\getExternalTaxRate
getExternalTaxRate()
Definition
CartSetShippingMethodActionBuilder.php:56
Commercetools\Api\Models\Cart\CartSetShippingMethodActionBuilder\withExternalTaxRateBuilder
withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate)
Definition
CartSetShippingMethodActionBuilder.php:98
Commercetools\Api\Models\Cart\CartSetShippingMethodActionBuilder\withShippingMethod
withShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod)
Definition
CartSetShippingMethodActionBuilder.php:65
Commercetools\Api\Models\Cart\CartSetShippingMethodActionBuilder\build
build()
Definition
CartSetShippingMethodActionBuilder.php:105
Commercetools\Api\Models\Cart\CartSetShippingMethodActionBuilder\withExternalTaxRate
withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate)
Definition
CartSetShippingMethodActionBuilder.php:76
Commercetools\Api\Models\Cart\CartSetShippingMethodActionModel
Definition
CartSetShippingMethodActionModel.php:23
Commercetools\Api\Models\Cart\ExternalTaxRateDraftBuilder
Definition
ExternalTaxRateDraftBuilder.php:23
Commercetools\Api\Models\Cart\ExternalTaxRateDraftBuilder\build
build()
Definition
ExternalTaxRateDraftBuilder.php:201
Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifierBuilder
Definition
ShippingMethodResourceIdentifierBuilder.php:24
Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifierBuilder\build
build()
Definition
ShippingMethodResourceIdentifierBuilder.php:82
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\CartSetShippingMethodAction
Definition
CartSetShippingMethodAction.php:16
Commercetools\Api\Models\Cart\ExternalTaxRateDraft
Definition
ExternalTaxRateDraft.php:16
Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifier
Definition
ShippingMethodResourceIdentifier.php:16
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