commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
VariantImagesSetMessagePayloadModel.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
24{
25 public const DISCRIMINATOR_VALUE = 'VariantImagesSet';
30 protected $type;
31
36 protected $product;
37
42 protected $images;
43
48 protected $oldImages;
49
54 protected $staged;
55
56
60 public function __construct(
64 ?bool $staged = null,
65 ?string $type = null
66 ) {
67 $this->product = $product;
68 $this->images = $images;
69 $this->oldImages = $oldImages;
70 $this->staged = $staged;
71 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
72 }
73
78 public function getType()
79 {
80 if (is_null($this->type)) {
82 $data = $this->raw(self::FIELD_TYPE);
83 if (is_null($data)) {
84 return null;
85 }
86 $this->type = (string) $data;
87 }
88
89 return $this->type;
90 }
91
98 public function getProduct()
99 {
100 if (is_null($this->product)) {
102 $data = $this->raw(self::FIELD_PRODUCT);
103 if (is_null($data)) {
104 return null;
105 }
106
107 $this->product = ProductReferenceModel::of($data);
108 }
109
110 return $this->product;
111 }
112
119 public function getImages()
120 {
121 if (is_null($this->images)) {
123 $data = $this->raw(self::FIELD_IMAGES);
124 if (is_null($data)) {
125 return null;
126 }
127 $this->images = ImageCollection::fromArray($data);
128 }
129
130 return $this->images;
131 }
132
139 public function getOldImages()
140 {
141 if (is_null($this->oldImages)) {
143 $data = $this->raw(self::FIELD_OLD_IMAGES);
144 if (is_null($data)) {
145 return null;
146 }
147 $this->oldImages = ImageCollection::fromArray($data);
148 }
149
150 return $this->oldImages;
151 }
152
159 public function getStaged()
160 {
161 if (is_null($this->staged)) {
163 $data = $this->raw(self::FIELD_STAGED);
164 if (is_null($data)) {
165 return null;
166 }
167 $this->staged = (bool) $data;
168 }
169
170 return $this->staged;
171 }
172
173
177 public function setProduct(?ProductReference $product): void
178 {
179 $this->product = $product;
180 }
181
185 public function setImages(?ImageCollection $images): void
186 {
187 $this->images = $images;
188 }
189
194 {
195 $this->oldImages = $oldImages;
196 }
197
201 public function setStaged(?bool $staged): void
202 {
203 $this->staged = $staged;
204 }
205}
__construct(?ProductReference $product=null, ?ImageCollection $images=null, ?ImageCollection $oldImages=null, ?bool $staged=null, ?string $type=null)