commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
TaxRateDraftModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
20 final class TaxRateDraftModel extends JsonObjectModel implements TaxRateDraft
21 {
26  protected $name;
27 
32  protected $amount;
33 
38  protected $includedInPrice;
39 
44  protected $country;
45 
50  protected $state;
51 
56  protected $subRates;
57 
62  protected $key;
63 
64 
68  public function __construct(
69  ?string $name = null,
70  ?float $amount = null,
71  ?bool $includedInPrice = null,
72  ?string $country = null,
73  ?string $state = null,
75  ?string $key = null
76  ) {
77  $this->name = $name;
78  $this->amount = $amount;
79  $this->includedInPrice = $includedInPrice;
80  $this->country = $country;
81  $this->state = $state;
82  $this->subRates = $subRates;
83  $this->key = $key;
84  }
85 
92  public function getName()
93  {
94  if (is_null($this->name)) {
96  $data = $this->raw(self::FIELD_NAME);
97  if (is_null($data)) {
98  return null;
99  }
100  $this->name = (string) $data;
101  }
102 
103  return $this->name;
104  }
105 
114  public function getAmount()
115  {
116  if (is_null($this->amount)) {
118  $data = $this->raw(self::FIELD_AMOUNT);
119  if (is_null($data)) {
120  return null;
121  }
122  $this->amount = (float) $data;
123  }
124 
125  return $this->amount;
126  }
127 
134  public function getIncludedInPrice()
135  {
136  if (is_null($this->includedInPrice)) {
138  $data = $this->raw(self::FIELD_INCLUDED_IN_PRICE);
139  if (is_null($data)) {
140  return null;
141  }
142  $this->includedInPrice = (bool) $data;
143  }
144 
145  return $this->includedInPrice;
146  }
147 
154  public function getCountry()
155  {
156  if (is_null($this->country)) {
158  $data = $this->raw(self::FIELD_COUNTRY);
159  if (is_null($data)) {
160  return null;
161  }
162  $this->country = (string) $data;
163  }
164 
165  return $this->country;
166  }
167 
174  public function getState()
175  {
176  if (is_null($this->state)) {
178  $data = $this->raw(self::FIELD_STATE);
179  if (is_null($data)) {
180  return null;
181  }
182  $this->state = (string) $data;
183  }
184 
185  return $this->state;
186  }
187 
195  public function getSubRates()
196  {
197  if (is_null($this->subRates)) {
199  $data = $this->raw(self::FIELD_SUB_RATES);
200  if (is_null($data)) {
201  return null;
202  }
203  $this->subRates = SubRateCollection::fromArray($data);
204  }
205 
206  return $this->subRates;
207  }
208 
215  public function getKey()
216  {
217  if (is_null($this->key)) {
219  $data = $this->raw(self::FIELD_KEY);
220  if (is_null($data)) {
221  return null;
222  }
223  $this->key = (string) $data;
224  }
225 
226  return $this->key;
227  }
228 
229 
233  public function setName(?string $name): void
234  {
235  $this->name = $name;
236  }
237 
241  public function setAmount(?float $amount): void
242  {
243  $this->amount = $amount;
244  }
245 
249  public function setIncludedInPrice(?bool $includedInPrice): void
250  {
251  $this->includedInPrice = $includedInPrice;
252  }
253 
257  public function setCountry(?string $country): void
258  {
259  $this->country = $country;
260  }
261 
265  public function setState(?string $state): void
266  {
267  $this->state = $state;
268  }
269 
273  public function setSubRates(?SubRateCollection $subRates): void
274  {
275  $this->subRates = $subRates;
276  }
277 
281  public function setKey(?string $key): void
282  {
283  $this->key = $key;
284  }
285 }
__construct(?string $name=null, ?float $amount=null, ?bool $includedInPrice=null, ?string $country=null, ?string $state=null, ?SubRateCollection $subRates=null, ?string $key=null)