commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
SetVariantExclusionChangeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
20
25{
26
27 public const DISCRIMINATOR_VALUE = 'SetVariantExclusionChange';
32 protected $type;
33
38 protected $change;
39
44 protected $product;
45
50 protected $previousValue;
51
56 protected $nextValue;
57
58
62 public function __construct(
63 ?string $change = null,
64 ?Reference $product = null,
67 ?string $type = null
68 ) {
69 $this->change = $change;
70 $this->product = $product;
71 $this->previousValue = $previousValue;
72 $this->nextValue = $nextValue;
73 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
74 }
75
80 public function getType()
81 {
82 if (is_null($this->type)) {
84 $data = $this->raw(self::FIELD_TYPE);
85 if (is_null($data)) {
86 return null;
87 }
88 $this->type = (string) $data;
89 }
90
91 return $this->type;
92 }
93
98 public function getChange()
99 {
100 if (is_null($this->change)) {
102 $data = $this->raw(self::FIELD_CHANGE);
103 if (is_null($data)) {
104 return null;
105 }
106 $this->change = (string) $data;
107 }
108
109 return $this->change;
110 }
111
118 public function getProduct()
119 {
120 if (is_null($this->product)) {
122 $data = $this->raw(self::FIELD_PRODUCT);
123 if (is_null($data)) {
124 return null;
125 }
126 $className = ReferenceModel::resolveDiscriminatorClass($data);
127 $this->product = $className::of($data);
128 }
129
130 return $this->product;
131 }
132
139 public function getPreviousValue()
140 {
141 if (is_null($this->previousValue)) {
143 $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
144 if (is_null($data)) {
145 return null;
146 }
147
148 $this->previousValue = ProductVariantExclusionModel::of($data);
149 }
150
152 }
153
160 public function getNextValue()
161 {
162 if (is_null($this->nextValue)) {
164 $data = $this->raw(self::FIELD_NEXT_VALUE);
165 if (is_null($data)) {
166 return null;
167 }
168
169 $this->nextValue = ProductVariantExclusionModel::of($data);
170 }
171
172 return $this->nextValue;
173 }
174
175
179 public function setChange(?string $change): void
180 {
181 $this->change = $change;
182 }
183
187 public function setProduct(?Reference $product): void
188 {
189 $this->product = $product;
190 }
191
196 {
197 $this->previousValue = $previousValue;
198 }
199
204 {
205 $this->nextValue = $nextValue;
206 }
207
208
209
210}
__construct(?string $change=null, ?Reference $product=null, ?ProductVariantExclusion $previousValue=null, ?ProductVariantExclusion $nextValue=null, ?string $type=null)