commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
MethodExternalTaxRateDraftModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
21 {
26  protected $shippingMethodKey;
27 
32  protected $taxRate;
33 
34 
38  public function __construct(
39  ?string $shippingMethodKey = 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 
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 }
__construct(?string $shippingMethodKey=null, ?ExternalTaxRateDraft $taxRate=null)