commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
VariantSkuSetMessagePayloadModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
24 public const DISCRIMINATOR_VALUE = 'VariantSkuSet';
29 protected $type;
30
35 protected $product;
36
41 protected $sku;
42
47 protected $oldSku;
48
53 protected $staged;
54
55
59 public function __construct(
61 ?string $sku = null,
62 ?string $oldSku = null,
63 ?bool $staged = null,
64 ?string $type = null
65 ) {
66 $this->product = $product;
67 $this->sku = $sku;
68 $this->oldSku = $oldSku;
69 $this->staged = $staged;
70 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
71 }
72
77 public function getType()
78 {
79 if (is_null($this->type)) {
81 $data = $this->raw(self::FIELD_TYPE);
82 if (is_null($data)) {
83 return null;
84 }
85 $this->type = (string) $data;
86 }
87
88 return $this->type;
89 }
90
97 public function getProduct()
98 {
99 if (is_null($this->product)) {
101 $data = $this->raw(self::FIELD_PRODUCT);
102 if (is_null($data)) {
103 return null;
104 }
105
106 $this->product = ProductReferenceModel::of($data);
107 }
108
109 return $this->product;
110 }
111
118 public function getSku()
119 {
120 if (is_null($this->sku)) {
122 $data = $this->raw(self::FIELD_SKU);
123 if (is_null($data)) {
124 return null;
125 }
126 $this->sku = (string) $data;
127 }
128
129 return $this->sku;
130 }
131
138 public function getOldSku()
139 {
140 if (is_null($this->oldSku)) {
142 $data = $this->raw(self::FIELD_OLD_SKU);
143 if (is_null($data)) {
144 return null;
145 }
146 $this->oldSku = (string) $data;
147 }
148
149 return $this->oldSku;
150 }
151
158 public function getStaged()
159 {
160 if (is_null($this->staged)) {
162 $data = $this->raw(self::FIELD_STAGED);
163 if (is_null($data)) {
164 return null;
165 }
166 $this->staged = (bool) $data;
167 }
168
169 return $this->staged;
170 }
171
172
176 public function setProduct(?ProductReference $product): void
177 {
178 $this->product = $product;
179 }
180
184 public function setSku(?string $sku): void
185 {
186 $this->sku = $sku;
187 }
188
192 public function setOldSku(?string $oldSku): void
193 {
194 $this->oldSku = $oldSku;
195 }
196
200 public function setStaged(?bool $staged): void
201 {
202 $this->staged = $staged;
203 }
204}
__construct(?ProductReference $product=null, ?string $sku=null, ?string $oldSku=null, ?bool $staged=null, ?string $type=null)