commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
AddPriceChangeBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
19 
23 final class AddPriceChangeBuilder implements Builder
24 {
29  private $change;
30 
35  private $nextValue;
36 
41  private $catalogData;
42 
47  private $priceId;
48 
53  public function getChange()
54  {
55  return $this->change;
56  }
57 
64  public function getNextValue()
65  {
66  return $this->nextValue instanceof PriceBuilder ? $this->nextValue->build() : $this->nextValue;
67  }
68 
78  public function getCatalogData()
79  {
80  return $this->catalogData;
81  }
82 
89  public function getPriceId()
90  {
91  return $this->priceId;
92  }
93 
98  public function withChange(?string $change)
99  {
100  $this->change = $change;
101 
102  return $this;
103  }
104 
109  public function withNextValue(?Price $nextValue)
110  {
111  $this->nextValue = $nextValue;
112 
113  return $this;
114  }
115 
120  public function withCatalogData(?string $catalogData)
121  {
122  $this->catalogData = $catalogData;
123 
124  return $this;
125  }
126 
131  public function withPriceId(?string $priceId)
132  {
133  $this->priceId = $priceId;
134 
135  return $this;
136  }
137 
142  public function withNextValueBuilder(?PriceBuilder $nextValue)
143  {
144  $this->nextValue = $nextValue;
145 
146  return $this;
147  }
148 
149  public function build(): AddPriceChange
150  {
151  return new AddPriceChangeModel(
152  $this->change,
153  $this->nextValue instanceof PriceBuilder ? $this->nextValue->build() : $this->nextValue,
154  $this->catalogData,
155  $this->priceId
156  );
157  }
158 
159  public static function of(): AddPriceChangeBuilder
160  {
161  return new self();
162  }
163 }