commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
CustomFieldEnumValueModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
21 {
26  protected $key;
27 
32  protected $label;
33 
34 
38  public function __construct(
39  ?string $key = null,
40  ?string $label = null
41  ) {
42  $this->key = $key;
43  $this->label = $label;
44  }
45 
52  public function getKey()
53  {
54  if (is_null($this->key)) {
56  $data = $this->raw(self::FIELD_KEY);
57  if (is_null($data)) {
58  return null;
59  }
60  $this->key = (string) $data;
61  }
62 
63  return $this->key;
64  }
65 
72  public function getLabel()
73  {
74  if (is_null($this->label)) {
76  $data = $this->raw(self::FIELD_LABEL);
77  if (is_null($data)) {
78  return null;
79  }
80  $this->label = (string) $data;
81  }
82 
83  return $this->label;
84  }
85 
86 
90  public function setKey(?string $key): void
91  {
92  $this->key = $key;
93  }
94 
98  public function setLabel(?string $label): void
99  {
100  $this->label = $label;
101  }
102 }