commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
CustomFieldLocalizedEnumValueBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
24 {
29  private $key;
30 
35  private $label;
36 
43  public function getKey()
44  {
45  return $this->key;
46  }
47 
54  public function getLabel()
55  {
56  return $this->label instanceof LocalizedStringBuilder ? $this->label->build() : $this->label;
57  }
58 
63  public function withKey(?string $key)
64  {
65  $this->key = $key;
66 
67  return $this;
68  }
69 
74  public function withLabel(?LocalizedString $label)
75  {
76  $this->label = $label;
77 
78  return $this;
79  }
80 
85  public function withLabelBuilder(?LocalizedStringBuilder $label)
86  {
87  $this->label = $label;
88 
89  return $this;
90  }
91 
93  {
95  $this->key,
96  $this->label instanceof LocalizedStringBuilder ? $this->label->build() : $this->label
97  );
98  }
99 
100  public static function of(): CustomFieldLocalizedEnumValueBuilder
101  {
102  return new self();
103  }
104 }