commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
DuplicatePriceKeyErrorBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
23 final class DuplicatePriceKeyErrorBuilder implements Builder
24 {
29  private $message;
30 
35  private $conflictingPrice;
36 
43  public function getMessage()
44  {
45  return $this->message;
46  }
47 
54  public function getConflictingPrice()
55  {
56  return $this->conflictingPrice instanceof PriceBuilder ? $this->conflictingPrice->build() : $this->conflictingPrice;
57  }
58 
63  public function withMessage(?string $message)
64  {
65  $this->message = $message;
66 
67  return $this;
68  }
69 
74  public function withConflictingPrice(?Price $conflictingPrice)
75  {
76  $this->conflictingPrice = $conflictingPrice;
77 
78  return $this;
79  }
80 
85  public function withConflictingPriceBuilder(?PriceBuilder $conflictingPrice)
86  {
87  $this->conflictingPrice = $conflictingPrice;
88 
89  return $this;
90  }
91 
92  public function build(): DuplicatePriceKeyError
93  {
94  return new DuplicatePriceKeyErrorModel(
95  $this->message,
96  $this->conflictingPrice instanceof PriceBuilder ? $this->conflictingPrice->build() : $this->conflictingPrice
97  );
98  }
99 
100  public static function of(): DuplicatePriceKeyErrorBuilder
101  {
102  return new self();
103  }
104 }