commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Cart
MethodExternalTaxRateDraftModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Cart
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use stdClass;
16
20
final
class
MethodExternalTaxRateDraftModel
extends
JsonObjectModel
implements
MethodExternalTaxRateDraft
21
{
26
protected
$shippingMethodKey
;
27
32
protected
$taxRate
;
33
34
38
public
function
__construct
(
39
?
string
$shippingMethodKey
=
null
,
40
?
ExternalTaxRateDraft
$taxRate
=
null
41
) {
42
$this->shippingMethodKey =
$shippingMethodKey
;
43
$this->taxRate =
$taxRate
;
44
}
45
52
public
function
getShippingMethodKey
()
53
{
54
if
(is_null($this->shippingMethodKey)) {
56
$data = $this->
raw
(self::FIELD_SHIPPING_METHOD_KEY);
57
if
(is_null($data)) {
58
return
null
;
59
}
60
$this->shippingMethodKey = (string) $data;
61
}
62
63
return
$this->shippingMethodKey
;
64
}
65
72
public
function
getTaxRate
()
73
{
74
if
(is_null($this->taxRate)) {
76
$data = $this->
raw
(self::FIELD_TAX_RATE);
77
if
(is_null($data)) {
78
return
null
;
79
}
80
81
$this->taxRate =
ExternalTaxRateDraftModel::of
($data);
82
}
83
84
return
$this->taxRate
;
85
}
86
87
91
public
function
setShippingMethodKey
(?
string
$shippingMethodKey
): void
92
{
93
$this->shippingMethodKey =
$shippingMethodKey
;
94
}
95
99
public
function
setTaxRate
(?
ExternalTaxRateDraft
$taxRate
): void
100
{
101
$this->taxRate =
$taxRate
;
102
}
103
}
Commercetools\Api\Models\Cart\MethodExternalTaxRateDraftModel
Definition:
MethodExternalTaxRateDraftModel.php:21
Commercetools\Api\Models\Cart\MethodExternalTaxRateDraftModel\setTaxRate
setTaxRate(?ExternalTaxRateDraft $taxRate)
Definition:
MethodExternalTaxRateDraftModel.php:99
Commercetools\Api\Models\Cart\MethodExternalTaxRateDraftModel\getShippingMethodKey
getShippingMethodKey()
Definition:
MethodExternalTaxRateDraftModel.php:52
Commercetools\Api\Models\Cart\MethodExternalTaxRateDraftModel\$shippingMethodKey
$shippingMethodKey
Definition:
MethodExternalTaxRateDraftModel.php:26
Commercetools\Api\Models\Cart\MethodExternalTaxRateDraftModel\__construct
__construct(?string $shippingMethodKey=null, ?ExternalTaxRateDraft $taxRate=null)
Definition:
MethodExternalTaxRateDraftModel.php:38
Commercetools\Api\Models\Cart\MethodExternalTaxRateDraftModel\setShippingMethodKey
setShippingMethodKey(?string $shippingMethodKey)
Definition:
MethodExternalTaxRateDraftModel.php:91
Commercetools\Api\Models\Cart\MethodExternalTaxRateDraftModel\getTaxRate
getTaxRate()
Definition:
MethodExternalTaxRateDraftModel.php:72
Commercetools\Api\Models\Cart\MethodExternalTaxRateDraftModel\$taxRate
$taxRate
Definition:
MethodExternalTaxRateDraftModel.php:32
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\ExternalTaxRateDraft
Definition:
ExternalTaxRateDraft.php:16
Commercetools\Api\Models\Cart\MethodExternalTaxRateDraft
Definition:
MethodExternalTaxRateDraft.php:15
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Cart
Definition:
Cart.php:9
Generated by
1.9.1