commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ChangeLabelChangeBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
19 
23 final class ChangeLabelChangeBuilder implements Builder
24 {
29  private $change;
30 
35  private $previousValue;
36 
41  private $nextValue;
42 
47  private $fieldName;
48 
53  private $attributeName;
54 
59  public function getChange()
60  {
61  return $this->change;
62  }
63 
70  public function getPreviousValue()
71  {
72  return $this->previousValue instanceof LocalizedStringBuilder ? $this->previousValue->build() : $this->previousValue;
73  }
74 
81  public function getNextValue()
82  {
83  return $this->nextValue instanceof LocalizedStringBuilder ? $this->nextValue->build() : $this->nextValue;
84  }
85 
92  public function getFieldName()
93  {
94  return $this->fieldName;
95  }
96 
103  public function getAttributeName()
104  {
105  return $this->attributeName;
106  }
107 
112  public function withChange(?string $change)
113  {
114  $this->change = $change;
115 
116  return $this;
117  }
118 
123  public function withPreviousValue(?LocalizedString $previousValue)
124  {
125  $this->previousValue = $previousValue;
126 
127  return $this;
128  }
129 
134  public function withNextValue(?LocalizedString $nextValue)
135  {
136  $this->nextValue = $nextValue;
137 
138  return $this;
139  }
140 
145  public function withFieldName(?string $fieldName)
146  {
147  $this->fieldName = $fieldName;
148 
149  return $this;
150  }
151 
156  public function withAttributeName(?string $attributeName)
157  {
158  $this->attributeName = $attributeName;
159 
160  return $this;
161  }
162 
167  public function withPreviousValueBuilder(?LocalizedStringBuilder $previousValue)
168  {
169  $this->previousValue = $previousValue;
170 
171  return $this;
172  }
173 
178  public function withNextValueBuilder(?LocalizedStringBuilder $nextValue)
179  {
180  $this->nextValue = $nextValue;
181 
182  return $this;
183  }
184 
185  public function build(): ChangeLabelChange
186  {
187  return new ChangeLabelChangeModel(
188  $this->change,
189  $this->previousValue instanceof LocalizedStringBuilder ? $this->previousValue->build() : $this->previousValue,
190  $this->nextValue instanceof LocalizedStringBuilder ? $this->nextValue->build() : $this->nextValue,
191  $this->fieldName,
192  $this->attributeName
193  );
194  }
195 
196  public static function of(): ChangeLabelChangeBuilder
197  {
198  return new self();
199  }
200 }