commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ClassificationShippingRateInputModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
17 use stdClass;
18 
23 {
24  public const DISCRIMINATOR_VALUE = 'Classification';
29  protected $type;
30 
35  protected $key;
36 
41  protected $label;
42 
43 
47  public function __construct(
48  ?string $key = null,
49  ?LocalizedString $label = null,
50  ?string $type = null
51  ) {
52  $this->key = $key;
53  $this->label = $label;
54  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
55  }
56 
61  public function getType()
62  {
63  if (is_null($this->type)) {
65  $data = $this->raw(self::FIELD_TYPE);
66  if (is_null($data)) {
67  return null;
68  }
69  $this->type = (string) $data;
70  }
71 
72  return $this->type;
73  }
74 
79  public function getKey()
80  {
81  if (is_null($this->key)) {
83  $data = $this->raw(self::FIELD_KEY);
84  if (is_null($data)) {
85  return null;
86  }
87  $this->key = (string) $data;
88  }
89 
90  return $this->key;
91  }
92 
104  public function getLabel()
105  {
106  if (is_null($this->label)) {
108  $data = $this->raw(self::FIELD_LABEL);
109  if (is_null($data)) {
110  return null;
111  }
112 
113  $this->label = LocalizedStringModel::of($data);
114  }
115 
116  return $this->label;
117  }
118 
119 
123  public function setKey(?string $key): void
124  {
125  $this->key = $key;
126  }
127 
131  public function setLabel(?LocalizedString $label): void
132  {
133  $this->label = $label;
134  }
135 }
static of($data=null)
Definition: MapperMap.php:45
__construct(?string $key=null, ?LocalizedString $label=null, ?string $type=null)