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