commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
TextLineItemValueBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
19
23final class TextLineItemValueBuilder implements Builder
24{
29 private $id;
30
35 private $name;
36
43 public function getId()
44 {
45 return $this->id;
46 }
47
54 public function getName()
55 {
56 return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
57 }
58
63 public function withId(?string $id)
64 {
65 $this->id = $id;
66
67 return $this;
68 }
69
74 public function withName(?LocalizedString $name)
75 {
76 $this->name = $name;
77
78 return $this;
79 }
80
86 {
87 $this->name = $name;
88
89 return $this;
90 }
91
92 public function build(): TextLineItemValue
93 {
94 return new TextLineItemValueModel(
95 $this->id,
96 $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name
97 );
98 }
99
100 public static function of(): TextLineItemValueBuilder
101 {
102 return new self();
103 }
104}