commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
LocalizableTextAttributeBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
24 {
29  private $name;
30 
35  private $value;
36 
45  public function getName()
46  {
47  return $this->name;
48  }
49 
61  public function getValue()
62  {
63  return $this->value instanceof LocalizedStringBuilder ? $this->value->build() : $this->value;
64  }
65 
70  public function withName(?string $name)
71  {
72  $this->name = $name;
73 
74  return $this;
75  }
76 
81  public function withValue(?LocalizedString $value)
82  {
83  $this->value = $value;
84 
85  return $this;
86  }
87 
92  public function withValueBuilder(?LocalizedStringBuilder $value)
93  {
94  $this->value = $value;
95 
96  return $this;
97  }
98 
99  public function build(): LocalizableTextAttribute
100  {
102  $this->name,
103  $this->value instanceof LocalizedStringBuilder ? $this->value->build() : $this->value
104  );
105  }
106 
107  public static function of(): LocalizableTextAttributeBuilder
108  {
109  return new self();
110  }
111 }