commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
TaxRateBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
21 final class TaxRateBuilder implements Builder
22 {
27  private $id;
28 
33  private $name;
34 
39  private $amount;
40 
45  private $includedInPrice;
46 
51  private $country;
52 
57  private $state;
58 
63  private $subRates;
64 
69  public function getId()
70  {
71  return $this->id;
72  }
73 
78  public function getName()
79  {
80  return $this->name;
81  }
82 
87  public function getAmount()
88  {
89  return $this->amount;
90  }
91 
96  public function getIncludedInPrice()
97  {
98  return $this->includedInPrice;
99  }
100 
107  public function getCountry()
108  {
109  return $this->country;
110  }
111 
116  public function getState()
117  {
118  return $this->state;
119  }
120 
125  public function getSubRates()
126  {
127  return $this->subRates;
128  }
129 
134  public function withId(?string $id)
135  {
136  $this->id = $id;
137 
138  return $this;
139  }
140 
145  public function withName(?string $name)
146  {
147  $this->name = $name;
148 
149  return $this;
150  }
151 
156  public function withAmount(?float $amount)
157  {
158  $this->amount = $amount;
159 
160  return $this;
161  }
162 
167  public function withIncludedInPrice(?bool $includedInPrice)
168  {
169  $this->includedInPrice = $includedInPrice;
170 
171  return $this;
172  }
173 
178  public function withCountry(?string $country)
179  {
180  $this->country = $country;
181 
182  return $this;
183  }
184 
189  public function withState(?string $state)
190  {
191  $this->state = $state;
192 
193  return $this;
194  }
195 
200  public function withSubRates(?SubRateCollection $subRates)
201  {
202  $this->subRates = $subRates;
203 
204  return $this;
205  }
206 
207 
208  public function build(): TaxRate
209  {
210  return new TaxRateModel(
211  $this->id,
212  $this->name,
213  $this->amount,
214  $this->includedInPrice,
215  $this->country,
216  $this->state,
217  $this->subRates
218  );
219  }
220 
221  public static function of(): TaxRateBuilder
222  {
223  return new self();
224  }
225 }