commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
SetDiscountedPriceChangeBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
21
26{
31 private $change;
32
37 private $previousValue;
38
43 private $nextValue;
44
49 private $catalogData;
50
55 private $variant;
56
61 private $priceId;
62
67 private $price;
68
73 public function getChange()
74 {
75 return $this->change;
76 }
77
84 public function getPreviousValue()
85 {
86 return $this->previousValue instanceof DiscountedPriceBuilder ? $this->previousValue->build() : $this->previousValue;
87 }
88
95 public function getNextValue()
96 {
97 return $this->nextValue instanceof DiscountedPriceBuilder ? $this->nextValue->build() : $this->nextValue;
98 }
99
110 public function getCatalogData()
111 {
112 return $this->catalogData;
113 }
114
122 public function getVariant()
123 {
124 return $this->variant;
125 }
126
133 public function getPriceId()
134 {
135 return $this->priceId;
136 }
137
144 public function getPrice()
145 {
146 return $this->price instanceof PriceBuilder ? $this->price->build() : $this->price;
147 }
148
153 public function withChange(?string $change)
154 {
155 $this->change = $change;
156
157 return $this;
158 }
159
164 public function withPreviousValue(?DiscountedPrice $previousValue)
165 {
166 $this->previousValue = $previousValue;
167
168 return $this;
169 }
170
175 public function withNextValue(?DiscountedPrice $nextValue)
176 {
177 $this->nextValue = $nextValue;
178
179 return $this;
180 }
181
186 public function withCatalogData(?string $catalogData)
187 {
188 $this->catalogData = $catalogData;
189
190 return $this;
191 }
192
197 public function withVariant(?string $variant)
198 {
199 $this->variant = $variant;
200
201 return $this;
202 }
203
208 public function withPriceId(?string $priceId)
209 {
210 $this->priceId = $priceId;
211
212 return $this;
213 }
214
219 public function withPrice(?Price $price)
220 {
221 $this->price = $price;
222
223 return $this;
224 }
225
230 public function withPreviousValueBuilder(?DiscountedPriceBuilder $previousValue)
231 {
232 $this->previousValue = $previousValue;
233
234 return $this;
235 }
236
241 public function withNextValueBuilder(?DiscountedPriceBuilder $nextValue)
242 {
243 $this->nextValue = $nextValue;
244
245 return $this;
246 }
247
252 public function withPriceBuilder(?PriceBuilder $price)
253 {
254 $this->price = $price;
255
256 return $this;
257 }
258
260 {
262 $this->change,
263 $this->previousValue instanceof DiscountedPriceBuilder ? $this->previousValue->build() : $this->previousValue,
264 $this->nextValue instanceof DiscountedPriceBuilder ? $this->nextValue->build() : $this->nextValue,
265 $this->catalogData,
266 $this->variant,
267 $this->priceId,
268 $this->price instanceof PriceBuilder ? $this->price->build() : $this->price
269 );
270 }
271
272 public static function of(): SetDiscountedPriceChangeBuilder
273 {
274 return new self();
275 }
276}