commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
StandalonePriceImportBuilder.php
1<?php
2
3declare(strict_types=1);
10
29use DateTimeImmutable;
30use stdClass;
31
36{
41 private $key;
42
47 private $sku;
48
53 private $value;
54
59 private $country;
60
65 private $customerGroup;
66
71 private $channel;
72
77 private $validFrom;
78
83 private $validUntil;
84
89 private $tiers;
90
95 private $discounted;
96
101 private $custom;
102
109 public function getKey()
110 {
111 return $this->key;
112 }
113
120 public function getSku()
121 {
122 return $this->sku;
123 }
124
131 public function getValue()
132 {
133 return $this->value instanceof TypedMoneyBuilder ? $this->value->build() : $this->value;
134 }
135
142 public function getCountry()
143 {
144 return $this->country;
145 }
146
154 public function getCustomerGroup()
155 {
156 return $this->customerGroup instanceof CustomerGroupKeyReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup;
157 }
158
166 public function getChannel()
167 {
168 return $this->channel instanceof ChannelKeyReferenceBuilder ? $this->channel->build() : $this->channel;
169 }
170
177 public function getValidFrom()
178 {
179 return $this->validFrom;
180 }
181
188 public function getValidUntil()
189 {
190 return $this->validUntil;
191 }
192
199 public function getTiers()
200 {
201 return $this->tiers;
202 }
203
210 public function getDiscounted()
211 {
212 return $this->discounted instanceof DiscountedPriceBuilder ? $this->discounted->build() : $this->discounted;
213 }
214
221 public function getCustom()
222 {
223 return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom;
224 }
225
230 public function withKey(?string $key)
231 {
232 $this->key = $key;
233
234 return $this;
235 }
236
241 public function withSku(?string $sku)
242 {
243 $this->sku = $sku;
244
245 return $this;
246 }
247
252 public function withValue(?TypedMoney $value)
253 {
254 $this->value = $value;
255
256 return $this;
257 }
258
263 public function withCountry(?string $country)
264 {
265 $this->country = $country;
266
267 return $this;
268 }
269
274 public function withCustomerGroup(?CustomerGroupKeyReference $customerGroup)
275 {
276 $this->customerGroup = $customerGroup;
277
278 return $this;
279 }
280
285 public function withChannel(?ChannelKeyReference $channel)
286 {
287 $this->channel = $channel;
288
289 return $this;
290 }
291
296 public function withValidFrom(?DateTimeImmutable $validFrom)
297 {
298 $this->validFrom = $validFrom;
299
300 return $this;
301 }
302
307 public function withValidUntil(?DateTimeImmutable $validUntil)
308 {
309 $this->validUntil = $validUntil;
310
311 return $this;
312 }
313
318 public function withTiers(?PriceTierCollection $tiers)
319 {
320 $this->tiers = $tiers;
321
322 return $this;
323 }
324
329 public function withDiscounted(?DiscountedPrice $discounted)
330 {
331 $this->discounted = $discounted;
332
333 return $this;
334 }
335
340 public function withCustom(?Custom $custom)
341 {
342 $this->custom = $custom;
343
344 return $this;
345 }
346
351 public function withValueBuilder(?TypedMoneyBuilder $value)
352 {
353 $this->value = $value;
354
355 return $this;
356 }
357
363 {
364 $this->customerGroup = $customerGroup;
365
366 return $this;
367 }
368
374 {
375 $this->channel = $channel;
376
377 return $this;
378 }
379
384 public function withDiscountedBuilder(?DiscountedPriceBuilder $discounted)
385 {
386 $this->discounted = $discounted;
387
388 return $this;
389 }
390
395 public function withCustomBuilder(?CustomBuilder $custom)
396 {
397 $this->custom = $custom;
398
399 return $this;
400 }
401
402 public function build(): StandalonePriceImport
403 {
405 $this->key,
406 $this->sku,
407 $this->value instanceof TypedMoneyBuilder ? $this->value->build() : $this->value,
408 $this->country,
409 $this->customerGroup instanceof CustomerGroupKeyReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup,
410 $this->channel instanceof ChannelKeyReferenceBuilder ? $this->channel->build() : $this->channel,
411 $this->validFrom,
412 $this->validUntil,
413 $this->tiers,
414 $this->discounted instanceof DiscountedPriceBuilder ? $this->discounted->build() : $this->discounted,
415 $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom
416 );
417 }
418
419 public static function of(): StandalonePriceImportBuilder
420 {
421 return new self();
422 }
423}