commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
SetAddressCustomFieldChangeModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
18 
23 {
24 
25  public const DISCRIMINATOR_VALUE = 'SetAddressCustomFieldChange';
30  protected $type;
31 
36  protected $change;
37 
42  protected $address;
43 
48  protected $name;
49 
54  protected $customTypeId;
55 
60  protected $previousValue;
61 
66  protected $nextValue;
67 
68 
72  public function __construct(
73  ?string $change = null,
74  ?Address $address = null,
75  ?string $name = null,
76  ?string $customTypeId = null,
77  $previousValue = null,
78  $nextValue = null,
79  ?string $type = null
80  ) {
81  $this->change = $change;
82  $this->address = $address;
83  $this->name = $name;
84  $this->customTypeId = $customTypeId;
85  $this->previousValue = $previousValue;
86  $this->nextValue = $nextValue;
87  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
88  }
89 
94  public function getType()
95  {
96  if (is_null($this->type)) {
98  $data = $this->raw(self::FIELD_TYPE);
99  if (is_null($data)) {
100  return null;
101  }
102  $this->type = (string) $data;
103  }
104 
105  return $this->type;
106  }
107 
112  public function getChange()
113  {
114  if (is_null($this->change)) {
116  $data = $this->raw(self::FIELD_CHANGE);
117  if (is_null($data)) {
118  return null;
119  }
120  $this->change = (string) $data;
121  }
122 
123  return $this->change;
124  }
125 
132  public function getAddress()
133  {
134  if (is_null($this->address)) {
136  $data = $this->raw(self::FIELD_ADDRESS);
137  if (is_null($data)) {
138  return null;
139  }
140 
141  $this->address = AddressModel::of($data);
142  }
143 
144  return $this->address;
145  }
146 
153  public function getName()
154  {
155  if (is_null($this->name)) {
157  $data = $this->raw(self::FIELD_NAME);
158  if (is_null($data)) {
159  return null;
160  }
161  $this->name = (string) $data;
162  }
163 
164  return $this->name;
165  }
166 
173  public function getCustomTypeId()
174  {
175  if (is_null($this->customTypeId)) {
177  $data = $this->raw(self::FIELD_CUSTOM_TYPE_ID);
178  if (is_null($data)) {
179  return null;
180  }
181  $this->customTypeId = (string) $data;
182  }
183 
184  return $this->customTypeId;
185  }
186 
193  public function getPreviousValue()
194  {
195  if (is_null($this->previousValue)) {
197  $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
198  if (is_null($data)) {
199  return null;
200  }
201  $this->previousValue = $data;
202  }
203 
204  return $this->previousValue;
205  }
206 
213  public function getNextValue()
214  {
215  if (is_null($this->nextValue)) {
217  $data = $this->raw(self::FIELD_NEXT_VALUE);
218  if (is_null($data)) {
219  return null;
220  }
221  $this->nextValue = $data;
222  }
223 
224  return $this->nextValue;
225  }
226 
227 
231  public function setChange(?string $change): void
232  {
233  $this->change = $change;
234  }
235 
239  public function setAddress(?Address $address): void
240  {
241  $this->address = $address;
242  }
243 
247  public function setName(?string $name): void
248  {
249  $this->name = $name;
250  }
251 
255  public function setCustomTypeId(?string $customTypeId): void
256  {
257  $this->customTypeId = $customTypeId;
258  }
259 
263  public function setPreviousValue( $previousValue): void
264  {
265  $this->previousValue = $previousValue;
266  }
267 
271  public function setNextValue( $nextValue): void
272  {
273  $this->nextValue = $nextValue;
274  }
275 
276 
277 
278 }
__construct(?string $change=null, ?Address $address=null, ?string $name=null, ?string $customTypeId=null, $previousValue=null, $nextValue=null, ?string $type=null)