commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
SetStoresChangeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
18
23{
24
25 public const DISCRIMINATOR_VALUE = 'SetStoresChange';
30 protected $type;
31
36 protected $change;
37
42 protected $previousValue;
43
48 protected $nextValue;
49
54 protected $addedItems;
55
60 protected $removedItems;
61
62
66 public function __construct(
67 ?string $change = null,
72 ?string $type = null
73 ) {
74 $this->change = $change;
75 $this->previousValue = $previousValue;
76 $this->nextValue = $nextValue;
77 $this->addedItems = $addedItems;
78 $this->removedItems = $removedItems;
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 $this->previousValue = ReferenceCollection::fromArray($data);
133 }
134
136 }
137
144 public function getNextValue()
145 {
146 if (is_null($this->nextValue)) {
148 $data = $this->raw(self::FIELD_NEXT_VALUE);
149 if (is_null($data)) {
150 return null;
151 }
152 $this->nextValue = ReferenceCollection::fromArray($data);
153 }
154
155 return $this->nextValue;
156 }
157
164 public function getAddedItems()
165 {
166 if (is_null($this->addedItems)) {
168 $data = $this->raw(self::FIELD_ADDED_ITEMS);
169 if (is_null($data)) {
170 return null;
171 }
172 $this->addedItems = KeyReferenceCollection::fromArray($data);
173 }
174
175 return $this->addedItems;
176 }
177
184 public function getRemovedItems()
185 {
186 if (is_null($this->removedItems)) {
188 $data = $this->raw(self::FIELD_REMOVED_ITEMS);
189 if (is_null($data)) {
190 return null;
191 }
192 $this->removedItems = KeyReferenceCollection::fromArray($data);
193 }
194
195 return $this->removedItems;
196 }
197
198
202 public function setChange(?string $change): void
203 {
204 $this->change = $change;
205 }
206
211 {
212 $this->previousValue = $previousValue;
213 }
214
219 {
220 $this->nextValue = $nextValue;
221 }
222
227 {
228 $this->addedItems = $addedItems;
229 }
230
235 {
236 $this->removedItems = $removedItems;
237 }
238
239
240
241}
__construct(?string $change=null, ?ReferenceCollection $previousValue=null, ?ReferenceCollection $nextValue=null, ?KeyReferenceCollection $addedItems=null, ?KeyReferenceCollection $removedItems=null, ?string $type=null)