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
CartSetShippingMethodActionModel.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\ShippingMethodResourceIdentifierModel
;
13
use
Commercetools\Base\DateTimeImmutableCollection
;
14
use
Commercetools\Base\JsonObject
;
15
use
Commercetools\Base\JsonObjectModel
;
16
use
Commercetools\Base\MapperFactory
;
17
use stdClass;
18
22
final
class
CartSetShippingMethodActionModel
extends
JsonObjectModel
implements
CartSetShippingMethodAction
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'setShippingMethod'
;
29
protected
$action
;
30
35
protected
$shippingMethod
;
36
41
protected
$externalTaxRate
;
42
47
protected
$estimatedDelivery
;
48
49
53
public
function
__construct
(
54
?
ShippingMethodResourceIdentifier
$shippingMethod
=
null
,
55
?
ExternalTaxRateDraft
$externalTaxRate
=
null
,
56
?
EstimatedDelivery
$estimatedDelivery
=
null
,
57
?
string
$action
=
null
58
) {
59
$this->shippingMethod =
$shippingMethod
;
60
$this->externalTaxRate =
$externalTaxRate
;
61
$this->estimatedDelivery =
$estimatedDelivery
;
62
$this->action =
$action
??
self::DISCRIMINATOR_VALUE
;
63
}
64
69
public
function
getAction
()
70
{
71
if
(is_null($this->action)) {
73
$data = $this->
raw
(self::FIELD_ACTION);
74
if
(is_null($data)) {
75
return
null
;
76
}
77
$this->action = (string) $data;
78
}
79
80
return
$this->action
;
81
}
82
97
public
function
getShippingMethod
()
98
{
99
if
(is_null($this->shippingMethod)) {
101
$data = $this->
raw
(self::FIELD_SHIPPING_METHOD);
102
if
(is_null($data)) {
103
return
null
;
104
}
105
106
$this->shippingMethod = ShippingMethodResourceIdentifierModel::of($data);
107
}
108
109
return
$this->shippingMethod
;
110
}
111
118
public
function
getExternalTaxRate
()
119
{
120
if
(is_null($this->externalTaxRate)) {
122
$data = $this->
raw
(self::FIELD_EXTERNAL_TAX_RATE);
123
if
(is_null($data)) {
124
return
null
;
125
}
126
127
$this->externalTaxRate =
ExternalTaxRateDraftModel::of
($data);
128
}
129
130
return
$this->externalTaxRate
;
131
}
132
140
public
function
getEstimatedDelivery
()
141
{
142
if
(is_null($this->estimatedDelivery)) {
144
$data = $this->
raw
(self::FIELD_ESTIMATED_DELIVERY);
145
if
(is_null($data)) {
146
return
null
;
147
}
148
149
$this->estimatedDelivery =
EstimatedDeliveryModel::of
($data);
150
}
151
152
return
$this->estimatedDelivery
;
153
}
154
155
159
public
function
setShippingMethod
(?
ShippingMethodResourceIdentifier
$shippingMethod
): void
160
{
161
$this->shippingMethod =
$shippingMethod
;
162
}
163
167
public
function
setExternalTaxRate
(?
ExternalTaxRateDraft
$externalTaxRate
): void
168
{
169
$this->externalTaxRate =
$externalTaxRate
;
170
}
171
175
public
function
setEstimatedDelivery
(?
EstimatedDelivery
$estimatedDelivery
): void
176
{
177
$this->estimatedDelivery =
$estimatedDelivery
;
178
}
179
}
Commercetools\Api\Models\Cart\CartSetShippingMethodActionModel
Definition
CartSetShippingMethodActionModel.php:23
Commercetools\Api\Models\Cart\CartSetShippingMethodActionModel\$estimatedDelivery
$estimatedDelivery
Definition
CartSetShippingMethodActionModel.php:47
Commercetools\Api\Models\Cart\CartSetShippingMethodActionModel\__construct
__construct(?ShippingMethodResourceIdentifier $shippingMethod=null, ?ExternalTaxRateDraft $externalTaxRate=null, ?EstimatedDelivery $estimatedDelivery=null, ?string $action=null)
Definition
CartSetShippingMethodActionModel.php:53
Commercetools\Api\Models\Cart\CartSetShippingMethodActionModel\getShippingMethod
getShippingMethod()
Definition
CartSetShippingMethodActionModel.php:97
Commercetools\Api\Models\Cart\CartSetShippingMethodActionModel\getAction
getAction()
Definition
CartSetShippingMethodActionModel.php:69
Commercetools\Api\Models\Cart\CartSetShippingMethodActionModel\getExternalTaxRate
getExternalTaxRate()
Definition
CartSetShippingMethodActionModel.php:118
Commercetools\Api\Models\Cart\CartSetShippingMethodActionModel\setEstimatedDelivery
setEstimatedDelivery(?EstimatedDelivery $estimatedDelivery)
Definition
CartSetShippingMethodActionModel.php:175
Commercetools\Api\Models\Cart\CartSetShippingMethodActionModel\setExternalTaxRate
setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate)
Definition
CartSetShippingMethodActionModel.php:167
Commercetools\Api\Models\Cart\CartSetShippingMethodActionModel\getEstimatedDelivery
getEstimatedDelivery()
Definition
CartSetShippingMethodActionModel.php:140
Commercetools\Api\Models\Cart\CartSetShippingMethodActionModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
CartSetShippingMethodActionModel.php:24
Commercetools\Api\Models\Cart\CartSetShippingMethodActionModel\$shippingMethod
$shippingMethod
Definition
CartSetShippingMethodActionModel.php:35
Commercetools\Api\Models\Cart\CartSetShippingMethodActionModel\$externalTaxRate
$externalTaxRate
Definition
CartSetShippingMethodActionModel.php:41
Commercetools\Api\Models\Cart\CartSetShippingMethodActionModel\setShippingMethod
setShippingMethod(?ShippingMethodResourceIdentifier $shippingMethod)
Definition
CartSetShippingMethodActionModel.php:159
Commercetools\Api\Models\Cart\CartSetShippingMethodActionModel\$action
$action
Definition
CartSetShippingMethodActionModel.php:29
Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifierModel
Definition
ShippingMethodResourceIdentifierModel.php:23
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition
BaseJsonObject.php:57
Commercetools\Base\BaseJsonObject\of
static of($data=null)
Definition
BaseJsonObject.php:26
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\EstimatedDelivery
Definition
EstimatedDelivery.php:16
Commercetools\Api\Models\Cart\ExternalTaxRateDraft
Definition
ExternalTaxRateDraft.php:16
Commercetools\Api\Models\ShippingMethod\ShippingMethodResourceIdentifier
Definition
ShippingMethodResourceIdentifier.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Cart
Definition
AbsoluteAllocation.php:9
Generated by
1.9.8