commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
MethodExternalTaxRateDraftBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
22 {
27  private $shippingMethodKey;
28 
33  private $taxRate;
34 
41  public function getShippingMethodKey()
42  {
43  return $this->shippingMethodKey;
44  }
45 
52  public function getTaxRate()
53  {
54  return $this->taxRate instanceof ExternalTaxRateDraftBuilder ? $this->taxRate->build() : $this->taxRate;
55  }
56 
61  public function withShippingMethodKey(?string $shippingMethodKey)
62  {
63  $this->shippingMethodKey = $shippingMethodKey;
64 
65  return $this;
66  }
67 
72  public function withTaxRate(?ExternalTaxRateDraft $taxRate)
73  {
74  $this->taxRate = $taxRate;
75 
76  return $this;
77  }
78 
84  {
85  $this->taxRate = $taxRate;
86 
87  return $this;
88  }
89 
90  public function build(): MethodExternalTaxRateDraft
91  {
93  $this->shippingMethodKey,
94  $this->taxRate instanceof ExternalTaxRateDraftBuilder ? $this->taxRate->build() : $this->taxRate
95  );
96  }
97 
98  public static function of(): MethodExternalTaxRateDraftBuilder
99  {
100  return new self();
101  }
102 }