commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ShippingMethodDraftModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
21 use stdClass;
22 
27 {
32  protected $key;
33 
38  protected $name;
39 
44  protected $localizedName;
45 
50  protected $description;
51 
57 
62  protected $taxCategory;
63 
68  protected $zoneRates;
69 
74  protected $active;
75 
80  protected $isDefault;
81 
86  protected $predicate;
87 
92  protected $custom;
93 
94 
98  public function __construct(
99  ?string $key = null,
100  ?string $name = null,
102  ?string $description = null,
106  ?bool $active = null,
107  ?bool $isDefault = null,
108  ?string $predicate = null,
109  ?CustomFieldsDraft $custom = null
110  ) {
111  $this->key = $key;
112  $this->name = $name;
113  $this->localizedName = $localizedName;
114  $this->description = $description;
115  $this->localizedDescription = $localizedDescription;
116  $this->taxCategory = $taxCategory;
117  $this->zoneRates = $zoneRates;
118  $this->active = $active;
119  $this->isDefault = $isDefault;
120  $this->predicate = $predicate;
121  $this->custom = $custom;
122  }
123 
130  public function getKey()
131  {
132  if (is_null($this->key)) {
134  $data = $this->raw(self::FIELD_KEY);
135  if (is_null($data)) {
136  return null;
137  }
138  $this->key = (string) $data;
139  }
140 
141  return $this->key;
142  }
143 
150  public function getName()
151  {
152  if (is_null($this->name)) {
154  $data = $this->raw(self::FIELD_NAME);
155  if (is_null($data)) {
156  return null;
157  }
158  $this->name = (string) $data;
159  }
160 
161  return $this->name;
162  }
163 
170  public function getLocalizedName()
171  {
172  if (is_null($this->localizedName)) {
174  $data = $this->raw(self::FIELD_LOCALIZED_NAME);
175  if (is_null($data)) {
176  return null;
177  }
178 
179  $this->localizedName = LocalizedStringModel::of($data);
180  }
181 
182  return $this->localizedName;
183  }
184 
191  public function getDescription()
192  {
193  if (is_null($this->description)) {
195  $data = $this->raw(self::FIELD_DESCRIPTION);
196  if (is_null($data)) {
197  return null;
198  }
199  $this->description = (string) $data;
200  }
201 
202  return $this->description;
203  }
204 
211  public function getLocalizedDescription()
212  {
213  if (is_null($this->localizedDescription)) {
215  $data = $this->raw(self::FIELD_LOCALIZED_DESCRIPTION);
216  if (is_null($data)) {
217  return null;
218  }
219 
220  $this->localizedDescription = LocalizedStringModel::of($data);
221  }
222 
224  }
225 
232  public function getTaxCategory()
233  {
234  if (is_null($this->taxCategory)) {
236  $data = $this->raw(self::FIELD_TAX_CATEGORY);
237  if (is_null($data)) {
238  return null;
239  }
240 
241  $this->taxCategory = TaxCategoryResourceIdentifierModel::of($data);
242  }
243 
244  return $this->taxCategory;
245  }
246 
253  public function getZoneRates()
254  {
255  if (is_null($this->zoneRates)) {
257  $data = $this->raw(self::FIELD_ZONE_RATES);
258  if (is_null($data)) {
259  return null;
260  }
261  $this->zoneRates = ZoneRateDraftCollection::fromArray($data);
262  }
263 
264  return $this->zoneRates;
265  }
266 
273  public function getActive()
274  {
275  if (is_null($this->active)) {
277  $data = $this->raw(self::FIELD_ACTIVE);
278  if (is_null($data)) {
279  return null;
280  }
281  $this->active = (bool) $data;
282  }
283 
284  return $this->active;
285  }
286 
293  public function getIsDefault()
294  {
295  if (is_null($this->isDefault)) {
297  $data = $this->raw(self::FIELD_IS_DEFAULT);
298  if (is_null($data)) {
299  return null;
300  }
301  $this->isDefault = (bool) $data;
302  }
303 
304  return $this->isDefault;
305  }
306 
313  public function getPredicate()
314  {
315  if (is_null($this->predicate)) {
317  $data = $this->raw(self::FIELD_PREDICATE);
318  if (is_null($data)) {
319  return null;
320  }
321  $this->predicate = (string) $data;
322  }
323 
324  return $this->predicate;
325  }
326 
333  public function getCustom()
334  {
335  if (is_null($this->custom)) {
337  $data = $this->raw(self::FIELD_CUSTOM);
338  if (is_null($data)) {
339  return null;
340  }
341 
342  $this->custom = CustomFieldsDraftModel::of($data);
343  }
344 
345  return $this->custom;
346  }
347 
348 
352  public function setKey(?string $key): void
353  {
354  $this->key = $key;
355  }
356 
360  public function setName(?string $name): void
361  {
362  $this->name = $name;
363  }
364 
369  {
370  $this->localizedName = $localizedName;
371  }
372 
376  public function setDescription(?string $description): void
377  {
378  $this->description = $description;
379  }
380 
385  {
386  $this->localizedDescription = $localizedDescription;
387  }
388 
393  {
394  $this->taxCategory = $taxCategory;
395  }
396 
401  {
402  $this->zoneRates = $zoneRates;
403  }
404 
408  public function setActive(?bool $active): void
409  {
410  $this->active = $active;
411  }
412 
416  public function setIsDefault(?bool $isDefault): void
417  {
418  $this->isDefault = $isDefault;
419  }
420 
424  public function setPredicate(?string $predicate): void
425  {
426  $this->predicate = $predicate;
427  }
428 
432  public function setCustom(?CustomFieldsDraft $custom): void
433  {
434  $this->custom = $custom;
435  }
436 }
__construct(?string $key=null, ?string $name=null, ?LocalizedString $localizedName=null, ?string $description=null, ?LocalizedString $localizedDescription=null, ?TaxCategoryResourceIdentifier $taxCategory=null, ?ZoneRateDraftCollection $zoneRates=null, ?bool $active=null, ?bool $isDefault=null, ?string $predicate=null, ?CustomFieldsDraft $custom=null)
static of($data=null)
Definition: MapperMap.php:45