commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
SetSkuChangeModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
20 final class SetSkuChangeModel extends JsonObjectModel implements SetSkuChange
21 {
22 
23  public const DISCRIMINATOR_VALUE = 'SetSkuChange';
28  protected $type;
29 
34  protected $change;
35 
40  protected $previousValue;
41 
46  protected $nextValue;
47 
52  protected $catalogData;
53 
54 
58  public function __construct(
59  ?string $change = null,
60  ?string $previousValue = null,
61  ?string $nextValue = null,
62  ?string $catalogData = null,
63  ?string $type = null
64  ) {
65  $this->change = $change;
66  $this->previousValue = $previousValue;
67  $this->nextValue = $nextValue;
68  $this->catalogData = $catalogData;
69  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
70  }
71 
76  public function getType()
77  {
78  if (is_null($this->type)) {
80  $data = $this->raw(self::FIELD_TYPE);
81  if (is_null($data)) {
82  return null;
83  }
84  $this->type = (string) $data;
85  }
86 
87  return $this->type;
88  }
89 
94  public function getChange()
95  {
96  if (is_null($this->change)) {
98  $data = $this->raw(self::FIELD_CHANGE);
99  if (is_null($data)) {
100  return null;
101  }
102  $this->change = (string) $data;
103  }
104 
105  return $this->change;
106  }
107 
114  public function getPreviousValue()
115  {
116  if (is_null($this->previousValue)) {
118  $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
119  if (is_null($data)) {
120  return null;
121  }
122  $this->previousValue = (string) $data;
123  }
124 
125  return $this->previousValue;
126  }
127 
134  public function getNextValue()
135  {
136  if (is_null($this->nextValue)) {
138  $data = $this->raw(self::FIELD_NEXT_VALUE);
139  if (is_null($data)) {
140  return null;
141  }
142  $this->nextValue = (string) $data;
143  }
144 
145  return $this->nextValue;
146  }
147 
157  public function getCatalogData()
158  {
159  if (is_null($this->catalogData)) {
161  $data = $this->raw(self::FIELD_CATALOG_DATA);
162  if (is_null($data)) {
163  return null;
164  }
165  $this->catalogData = (string) $data;
166  }
167 
168  return $this->catalogData;
169  }
170 
171 
175  public function setChange(?string $change): void
176  {
177  $this->change = $change;
178  }
179 
183  public function setPreviousValue(?string $previousValue): void
184  {
185  $this->previousValue = $previousValue;
186  }
187 
191  public function setNextValue(?string $nextValue): void
192  {
193  $this->nextValue = $nextValue;
194  }
195 
199  public function setCatalogData(?string $catalogData): void
200  {
201  $this->catalogData = $catalogData;
202  }
203 
204 
205 
206 }
__construct(?string $change=null, ?string $previousValue=null, ?string $nextValue=null, ?string $catalogData=null, ?string $type=null)