commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ChangePriceChangeBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
19 
23 final class ChangePriceChangeBuilder implements Builder
24 {
29  private $change;
30 
35  private $previousValue;
36 
41  private $nextValue;
42 
47  private $catalogData;
48 
53  private $priceId;
54 
59  public function getChange()
60  {
61  return $this->change;
62  }
63 
70  public function getPreviousValue()
71  {
72  return $this->previousValue instanceof PriceBuilder ? $this->previousValue->build() : $this->previousValue;
73  }
74 
81  public function getNextValue()
82  {
83  return $this->nextValue instanceof PriceBuilder ? $this->nextValue->build() : $this->nextValue;
84  }
85 
95  public function getCatalogData()
96  {
97  return $this->catalogData;
98  }
99 
106  public function getPriceId()
107  {
108  return $this->priceId;
109  }
110 
115  public function withChange(?string $change)
116  {
117  $this->change = $change;
118 
119  return $this;
120  }
121 
126  public function withPreviousValue(?Price $previousValue)
127  {
128  $this->previousValue = $previousValue;
129 
130  return $this;
131  }
132 
137  public function withNextValue(?Price $nextValue)
138  {
139  $this->nextValue = $nextValue;
140 
141  return $this;
142  }
143 
148  public function withCatalogData(?string $catalogData)
149  {
150  $this->catalogData = $catalogData;
151 
152  return $this;
153  }
154 
159  public function withPriceId(?string $priceId)
160  {
161  $this->priceId = $priceId;
162 
163  return $this;
164  }
165 
170  public function withPreviousValueBuilder(?PriceBuilder $previousValue)
171  {
172  $this->previousValue = $previousValue;
173 
174  return $this;
175  }
176 
181  public function withNextValueBuilder(?PriceBuilder $nextValue)
182  {
183  $this->nextValue = $nextValue;
184 
185  return $this;
186  }
187 
188  public function build(): ChangePriceChange
189  {
190  return new ChangePriceChangeModel(
191  $this->change,
192  $this->previousValue instanceof PriceBuilder ? $this->previousValue->build() : $this->previousValue,
193  $this->nextValue instanceof PriceBuilder ? $this->nextValue->build() : $this->nextValue,
194  $this->catalogData,
195  $this->priceId
196  );
197  }
198 
199  public static function of(): ChangePriceChangeBuilder
200  {
201  return new self();
202  }
203 }