commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
SetStoresChangeModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
17 
22 {
23 
24  public const DISCRIMINATOR_VALUE = 'SetStoresChange';
29  protected $type;
30 
35  protected $change;
36 
41  protected $previousValue;
42 
47  protected $nextValue;
48 
49 
53  public function __construct(
54  ?string $change = null,
57  ?string $type = null
58  ) {
59  $this->change = $change;
60  $this->previousValue = $previousValue;
61  $this->nextValue = $nextValue;
62  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
63  }
64 
69  public function getType()
70  {
71  if (is_null($this->type)) {
73  $data = $this->raw(self::FIELD_TYPE);
74  if (is_null($data)) {
75  return null;
76  }
77  $this->type = (string) $data;
78  }
79 
80  return $this->type;
81  }
82 
87  public function getChange()
88  {
89  if (is_null($this->change)) {
91  $data = $this->raw(self::FIELD_CHANGE);
92  if (is_null($data)) {
93  return null;
94  }
95  $this->change = (string) $data;
96  }
97 
98  return $this->change;
99  }
100 
107  public function getPreviousValue()
108  {
109  if (is_null($this->previousValue)) {
111  $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
112  if (is_null($data)) {
113  return null;
114  }
115  $this->previousValue = ReferenceCollection::fromArray($data);
116  }
117 
118  return $this->previousValue;
119  }
120 
127  public function getNextValue()
128  {
129  if (is_null($this->nextValue)) {
131  $data = $this->raw(self::FIELD_NEXT_VALUE);
132  if (is_null($data)) {
133  return null;
134  }
135  $this->nextValue = ReferenceCollection::fromArray($data);
136  }
137 
138  return $this->nextValue;
139  }
140 
141 
145  public function setChange(?string $change): void
146  {
147  $this->change = $change;
148  }
149 
154  {
155  $this->previousValue = $previousValue;
156  }
157 
162  {
163  $this->nextValue = $nextValue;
164  }
165 
166 
167 
168 }
__construct(?string $change=null, ?ReferenceCollection $previousValue=null, ?ReferenceCollection $nextValue=null, ?string $type=null)