commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
AddPriceChangeBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
19
23final class AddPriceChangeBuilder implements Builder
24{
29 private $change;
30
35 private $nextValue;
36
41 private $catalogData;
42
47 private $priceId;
48
53 private $variant;
54
59 public function getChange()
60 {
61 return $this->change;
62 }
63
70 public function getNextValue()
71 {
72 return $this->nextValue instanceof PriceBuilder ? $this->nextValue->build() : $this->nextValue;
73 }
74
85 public function getCatalogData()
86 {
87 return $this->catalogData;
88 }
89
96 public function getPriceId()
97 {
98 return $this->priceId;
99 }
100
108 public function getVariant()
109 {
110 return $this->variant;
111 }
112
117 public function withChange(?string $change)
118 {
119 $this->change = $change;
120
121 return $this;
122 }
123
128 public function withNextValue(?Price $nextValue)
129 {
130 $this->nextValue = $nextValue;
131
132 return $this;
133 }
134
139 public function withCatalogData(?string $catalogData)
140 {
141 $this->catalogData = $catalogData;
142
143 return $this;
144 }
145
150 public function withPriceId(?string $priceId)
151 {
152 $this->priceId = $priceId;
153
154 return $this;
155 }
156
161 public function withVariant(?string $variant)
162 {
163 $this->variant = $variant;
164
165 return $this;
166 }
167
172 public function withNextValueBuilder(?PriceBuilder $nextValue)
173 {
174 $this->nextValue = $nextValue;
175
176 return $this;
177 }
178
179 public function build(): AddPriceChange
180 {
181 return new AddPriceChangeModel(
182 $this->change,
183 $this->nextValue instanceof PriceBuilder ? $this->nextValue->build() : $this->nextValue,
184 $this->catalogData,
185 $this->priceId,
186 $this->variant
187 );
188 }
189
190 public static function of(): AddPriceChangeBuilder
191 {
192 return new self();
193 }
194}