commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Cart
MethodTaxRateModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Cart
;
10
11
use
Commercetools\Api\Models\TaxCategory\TaxRate
;
12
use
Commercetools\Api\Models\TaxCategory\TaxRateModel
;
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
MethodTaxRateModel
extends
JsonObjectModel
implements
MethodTaxRate
23
{
28
protected
$shippingMethodKey
;
29
34
protected
$taxRate
;
35
36
40
public
function
__construct
(
41
?
string
$shippingMethodKey
=
null
,
42
?
TaxRate
$taxRate
=
null
43
) {
44
$this->shippingMethodKey =
$shippingMethodKey
;
45
$this->taxRate =
$taxRate
;
46
}
47
54
public
function
getShippingMethodKey
()
55
{
56
if
(is_null($this->shippingMethodKey)) {
58
$data = $this->
raw
(self::FIELD_SHIPPING_METHOD_KEY);
59
if
(is_null($data)) {
60
return
null
;
61
}
62
$this->shippingMethodKey = (string) $data;
63
}
64
65
return
$this->shippingMethodKey
;
66
}
67
74
public
function
getTaxRate
()
75
{
76
if
(is_null($this->taxRate)) {
78
$data = $this->
raw
(self::FIELD_TAX_RATE);
79
if
(is_null($data)) {
80
return
null
;
81
}
82
83
$this->taxRate =
TaxRateModel::of
($data);
84
}
85
86
return
$this->taxRate
;
87
}
88
89
93
public
function
setShippingMethodKey
(?
string
$shippingMethodKey
): void
94
{
95
$this->shippingMethodKey =
$shippingMethodKey
;
96
}
97
101
public
function
setTaxRate
(?
TaxRate
$taxRate
): void
102
{
103
$this->taxRate =
$taxRate
;
104
}
105
}
Commercetools\Api\Models\Cart\MethodTaxRateModel
Definition:
MethodTaxRateModel.php:23
Commercetools\Api\Models\Cart\MethodTaxRateModel\__construct
__construct(?string $shippingMethodKey=null, ?TaxRate $taxRate=null)
Definition:
MethodTaxRateModel.php:40
Commercetools\Api\Models\Cart\MethodTaxRateModel\$shippingMethodKey
$shippingMethodKey
Definition:
MethodTaxRateModel.php:28
Commercetools\Api\Models\Cart\MethodTaxRateModel\getShippingMethodKey
getShippingMethodKey()
Definition:
MethodTaxRateModel.php:54
Commercetools\Api\Models\Cart\MethodTaxRateModel\setShippingMethodKey
setShippingMethodKey(?string $shippingMethodKey)
Definition:
MethodTaxRateModel.php:93
Commercetools\Api\Models\Cart\MethodTaxRateModel\getTaxRate
getTaxRate()
Definition:
MethodTaxRateModel.php:74
Commercetools\Api\Models\Cart\MethodTaxRateModel\$taxRate
$taxRate
Definition:
MethodTaxRateModel.php:34
Commercetools\Api\Models\Cart\MethodTaxRateModel\setTaxRate
setTaxRate(?TaxRate $taxRate)
Definition:
MethodTaxRateModel.php:101
Commercetools\Api\Models\TaxCategory\TaxRateModel
Definition:
TaxRateModel.php:21
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\MethodTaxRate
Definition:
MethodTaxRate.php:16
Commercetools\Api\Models\TaxCategory\TaxRate
Definition:
TaxRate.php:15
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Cart
Definition:
Cart.php:9
Generated by
1.9.1