commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ExternalTaxRateDraftModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
22 {
27  protected $name;
28 
33  protected $amount;
34 
39  protected $country;
40 
45  protected $state;
46 
51  protected $subRates;
52 
57  protected $includedInPrice;
58 
59 
63  public function __construct(
64  ?string $name = null,
65  ?float $amount = null,
66  ?string $country = null,
67  ?string $state = null,
69  ?bool $includedInPrice = null
70  ) {
71  $this->name = $name;
72  $this->amount = $amount;
73  $this->country = $country;
74  $this->state = $state;
75  $this->subRates = $subRates;
76  $this->includedInPrice = $includedInPrice;
77  }
78 
83  public function getName()
84  {
85  if (is_null($this->name)) {
87  $data = $this->raw(self::FIELD_NAME);
88  if (is_null($data)) {
89  return null;
90  }
91  $this->name = (string) $data;
92  }
93 
94  return $this->name;
95  }
96 
101  public function getAmount()
102  {
103  if (is_null($this->amount)) {
105  $data = $this->raw(self::FIELD_AMOUNT);
106  if (is_null($data)) {
107  return null;
108  }
109  $this->amount = (float) $data;
110  }
111 
112  return $this->amount;
113  }
114 
119  public function getCountry()
120  {
121  if (is_null($this->country)) {
123  $data = $this->raw(self::FIELD_COUNTRY);
124  if (is_null($data)) {
125  return null;
126  }
127  $this->country = (string) $data;
128  }
129 
130  return $this->country;
131  }
132 
137  public function getState()
138  {
139  if (is_null($this->state)) {
141  $data = $this->raw(self::FIELD_STATE);
142  if (is_null($data)) {
143  return null;
144  }
145  $this->state = (string) $data;
146  }
147 
148  return $this->state;
149  }
150 
155  public function getSubRates()
156  {
157  if (is_null($this->subRates)) {
159  $data = $this->raw(self::FIELD_SUB_RATES);
160  if (is_null($data)) {
161  return null;
162  }
163  $this->subRates = SubRateCollection::fromArray($data);
164  }
165 
166  return $this->subRates;
167  }
168 
173  public function getIncludedInPrice()
174  {
175  if (is_null($this->includedInPrice)) {
177  $data = $this->raw(self::FIELD_INCLUDED_IN_PRICE);
178  if (is_null($data)) {
179  return null;
180  }
181  $this->includedInPrice = (bool) $data;
182  }
183 
184  return $this->includedInPrice;
185  }
186 
187 
191  public function setName(?string $name): void
192  {
193  $this->name = $name;
194  }
195 
199  public function setAmount(?float $amount): void
200  {
201  $this->amount = $amount;
202  }
203 
207  public function setCountry(?string $country): void
208  {
209  $this->country = $country;
210  }
211 
215  public function setState(?string $state): void
216  {
217  $this->state = $state;
218  }
219 
223  public function setSubRates(?SubRateCollection $subRates): void
224  {
225  $this->subRates = $subRates;
226  }
227 
231  public function setIncludedInPrice(?bool $includedInPrice): void
232  {
233  $this->includedInPrice = $includedInPrice;
234  }
235 }
__construct(?string $name=null, ?float $amount=null, ?string $country=null, ?string $state=null, ?SubRateCollection $subRates=null, ?bool $includedInPrice=null)