commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
LocalizedStringFieldBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
23 final class LocalizedStringFieldBuilder implements Builder
24 {
29  private $value;
30 
42  public function getValue()
43  {
44  return $this->value instanceof LocalizedStringBuilder ? $this->value->build() : $this->value;
45  }
46 
51  public function withValue(?LocalizedString $value)
52  {
53  $this->value = $value;
54 
55  return $this;
56  }
57 
62  public function withValueBuilder(?LocalizedStringBuilder $value)
63  {
64  $this->value = $value;
65 
66  return $this;
67  }
68 
69  public function build(): LocalizedStringField
70  {
71  return new LocalizedStringFieldModel(
72  $this->value instanceof LocalizedStringBuilder ? $this->value->build() : $this->value
73  );
74  }
75 
76  public static function of(): LocalizedStringFieldBuilder
77  {
78  return new self();
79  }
80 }