commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
CustomFieldExpandedValueBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
19 
24 {
29  private $name;
30 
35  private $value;
36 
41  private $label;
42 
49  public function getName()
50  {
51  return $this->name;
52  }
53 
60  public function getValue()
61  {
62  return $this->value;
63  }
64 
71  public function getLabel()
72  {
73  return $this->label instanceof LocalizedStringBuilder ? $this->label->build() : $this->label;
74  }
75 
80  public function withName(?string $name)
81  {
82  $this->name = $name;
83 
84  return $this;
85  }
86 
91  public function withValue( $value)
92  {
93  $this->value = $value;
94 
95  return $this;
96  }
97 
102  public function withLabel(?LocalizedString $label)
103  {
104  $this->label = $label;
105 
106  return $this;
107  }
108 
113  public function withLabelBuilder(?LocalizedStringBuilder $label)
114  {
115  $this->label = $label;
116 
117  return $this;
118  }
119 
120  public function build(): CustomFieldExpandedValue
121  {
123  $this->name,
124  $this->value,
125  $this->label instanceof LocalizedStringBuilder ? $this->label->build() : $this->label
126  );
127  }
128 
129  public static function of(): CustomFieldExpandedValueBuilder
130  {
131  return new self();
132  }
133 }