commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
RemovePriceChangeModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
18 
23 {
24 
25  public const DISCRIMINATOR_VALUE = 'RemovePriceChange';
30  protected $type;
31 
36  protected $change;
37 
42  protected $previousValue;
43 
48  protected $nextValue;
49 
54  protected $catalogData;
55 
60  protected $priceId;
61 
62 
66  public function __construct(
67  ?string $change = null,
68  ?Price $previousValue = null,
69  ?Price $nextValue = null,
70  ?string $catalogData = null,
71  ?string $priceId = null,
72  ?string $type = null
73  ) {
74  $this->change = $change;
75  $this->previousValue = $previousValue;
76  $this->nextValue = $nextValue;
77  $this->catalogData = $catalogData;
78  $this->priceId = $priceId;
79  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
80  }
81 
86  public function getType()
87  {
88  if (is_null($this->type)) {
90  $data = $this->raw(self::FIELD_TYPE);
91  if (is_null($data)) {
92  return null;
93  }
94  $this->type = (string) $data;
95  }
96 
97  return $this->type;
98  }
99 
104  public function getChange()
105  {
106  if (is_null($this->change)) {
108  $data = $this->raw(self::FIELD_CHANGE);
109  if (is_null($data)) {
110  return null;
111  }
112  $this->change = (string) $data;
113  }
114 
115  return $this->change;
116  }
117 
124  public function getPreviousValue()
125  {
126  if (is_null($this->previousValue)) {
128  $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
129  if (is_null($data)) {
130  return null;
131  }
132 
133  $this->previousValue = PriceModel::of($data);
134  }
135 
136  return $this->previousValue;
137  }
138 
145  public function getNextValue()
146  {
147  if (is_null($this->nextValue)) {
149  $data = $this->raw(self::FIELD_NEXT_VALUE);
150  if (is_null($data)) {
151  return null;
152  }
153 
154  $this->nextValue = PriceModel::of($data);
155  }
156 
157  return $this->nextValue;
158  }
159 
169  public function getCatalogData()
170  {
171  if (is_null($this->catalogData)) {
173  $data = $this->raw(self::FIELD_CATALOG_DATA);
174  if (is_null($data)) {
175  return null;
176  }
177  $this->catalogData = (string) $data;
178  }
179 
180  return $this->catalogData;
181  }
182 
189  public function getPriceId()
190  {
191  if (is_null($this->priceId)) {
193  $data = $this->raw(self::FIELD_PRICE_ID);
194  if (is_null($data)) {
195  return null;
196  }
197  $this->priceId = (string) $data;
198  }
199 
200  return $this->priceId;
201  }
202 
203 
207  public function setChange(?string $change): void
208  {
209  $this->change = $change;
210  }
211 
215  public function setPreviousValue(?Price $previousValue): void
216  {
217  $this->previousValue = $previousValue;
218  }
219 
223  public function setNextValue(?Price $nextValue): void
224  {
225  $this->nextValue = $nextValue;
226  }
227 
231  public function setCatalogData(?string $catalogData): void
232  {
233  $this->catalogData = $catalogData;
234  }
235 
239  public function setPriceId(?string $priceId): void
240  {
241  $this->priceId = $priceId;
242  }
243 
244 
245 
246 }
__construct(?string $change=null, ?Price $previousValue=null, ?Price $nextValue=null, ?string $catalogData=null, ?string $priceId=null, ?string $type=null)