commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
AttributeLocalizedEnumValueBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
24 {
29  private $key;
30 
35  private $label;
36 
41  public function getKey()
42  {
43  return $this->key;
44  }
45 
57  public function getLabel()
58  {
59  return $this->label instanceof LocalizedStringBuilder ? $this->label->build() : $this->label;
60  }
61 
66  public function withKey(?string $key)
67  {
68  $this->key = $key;
69 
70  return $this;
71  }
72 
77  public function withLabel(?LocalizedString $label)
78  {
79  $this->label = $label;
80 
81  return $this;
82  }
83 
88  public function withLabelBuilder(?LocalizedStringBuilder $label)
89  {
90  $this->label = $label;
91 
92  return $this;
93  }
94 
96  {
98  $this->key,
99  $this->label instanceof LocalizedStringBuilder ? $this->label->build() : $this->label
100  );
101  }
102 
103  public static function of(): AttributeLocalizedEnumValueBuilder
104  {
105  return new self();
106  }
107 }