commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ChangePriceChangeBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
19
23final 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 private $variant;
60
65 public function getChange()
66 {
67 return $this->change;
68 }
69
76 public function getPreviousValue()
77 {
78 return $this->previousValue instanceof PriceBuilder ? $this->previousValue->build() : $this->previousValue;
79 }
80
87 public function getNextValue()
88 {
89 return $this->nextValue instanceof PriceBuilder ? $this->nextValue->build() : $this->nextValue;
90 }
91
102 public function getCatalogData()
103 {
104 return $this->catalogData;
105 }
106
113 public function getPriceId()
114 {
115 return $this->priceId;
116 }
117
125 public function getVariant()
126 {
127 return $this->variant;
128 }
129
134 public function withChange(?string $change)
135 {
136 $this->change = $change;
137
138 return $this;
139 }
140
145 public function withPreviousValue(?Price $previousValue)
146 {
147 $this->previousValue = $previousValue;
148
149 return $this;
150 }
151
156 public function withNextValue(?Price $nextValue)
157 {
158 $this->nextValue = $nextValue;
159
160 return $this;
161 }
162
167 public function withCatalogData(?string $catalogData)
168 {
169 $this->catalogData = $catalogData;
170
171 return $this;
172 }
173
178 public function withPriceId(?string $priceId)
179 {
180 $this->priceId = $priceId;
181
182 return $this;
183 }
184
189 public function withVariant(?string $variant)
190 {
191 $this->variant = $variant;
192
193 return $this;
194 }
195
200 public function withPreviousValueBuilder(?PriceBuilder $previousValue)
201 {
202 $this->previousValue = $previousValue;
203
204 return $this;
205 }
206
211 public function withNextValueBuilder(?PriceBuilder $nextValue)
212 {
213 $this->nextValue = $nextValue;
214
215 return $this;
216 }
217
218 public function build(): ChangePriceChange
219 {
220 return new ChangePriceChangeModel(
221 $this->change,
222 $this->previousValue instanceof PriceBuilder ? $this->previousValue->build() : $this->previousValue,
223 $this->nextValue instanceof PriceBuilder ? $this->nextValue->build() : $this->nextValue,
224 $this->catalogData,
225 $this->priceId,
226 $this->variant
227 );
228 }
229
230 public static function of(): ChangePriceChangeBuilder
231 {
232 return new self();
233 }
234}