commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
SetAssetSourcesChangeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
19
24{
25
26 public const DISCRIMINATOR_VALUE = 'SetAssetSourcesChange';
31 protected $type;
32
37 protected $change;
38
43 protected $previousValue;
44
49 protected $nextValue;
50
55 protected $asset;
56
57
61 public function __construct(
62 ?string $change = null,
66 ?string $type = null
67 ) {
68 $this->change = $change;
69 $this->previousValue = $previousValue;
70 $this->nextValue = $nextValue;
71 $this->asset = $asset;
72 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
73 }
74
79 public function getType()
80 {
81 if (is_null($this->type)) {
83 $data = $this->raw(self::FIELD_TYPE);
84 if (is_null($data)) {
85 return null;
86 }
87 $this->type = (string) $data;
88 }
89
90 return $this->type;
91 }
92
97 public function getChange()
98 {
99 if (is_null($this->change)) {
101 $data = $this->raw(self::FIELD_CHANGE);
102 if (is_null($data)) {
103 return null;
104 }
105 $this->change = (string) $data;
106 }
107
108 return $this->change;
109 }
110
117 public function getPreviousValue()
118 {
119 if (is_null($this->previousValue)) {
121 $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
122 if (is_null($data)) {
123 return null;
124 }
125 $this->previousValue = AssetSourceCollection::fromArray($data);
126 }
127
129 }
130
137 public function getNextValue()
138 {
139 if (is_null($this->nextValue)) {
141 $data = $this->raw(self::FIELD_NEXT_VALUE);
142 if (is_null($data)) {
143 return null;
144 }
145 $this->nextValue = AssetSourceCollection::fromArray($data);
146 }
147
148 return $this->nextValue;
149 }
150
157 public function getAsset()
158 {
159 if (is_null($this->asset)) {
161 $data = $this->raw(self::FIELD_ASSET);
162 if (is_null($data)) {
163 return null;
164 }
165
166 $this->asset = AssetChangeValueModel::of($data);
167 }
168
169 return $this->asset;
170 }
171
172
176 public function setChange(?string $change): void
177 {
178 $this->change = $change;
179 }
180
185 {
186 $this->previousValue = $previousValue;
187 }
188
193 {
194 $this->nextValue = $nextValue;
195 }
196
200 public function setAsset(?AssetChangeValue $asset): void
201 {
202 $this->asset = $asset;
203 }
204
205
206
207}
__construct(?string $change=null, ?AssetSourceCollection $previousValue=null, ?AssetSourceCollection $nextValue=null, ?AssetChangeValue $asset=null, ?string $type=null)