commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
Message
VariantImagesSetMessagePayloadModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Message
;
10
11
use
Commercetools\Api\Models\Common\ImageCollection
;
12
use
Commercetools\Api\Models\Product\ProductReference
;
13
use
Commercetools\Api\Models\Product\ProductReferenceModel
;
14
use
Commercetools\Base\DateTimeImmutableCollection
;
15
use
Commercetools\Base\JsonObject
;
16
use
Commercetools\Base\JsonObjectModel
;
17
use
Commercetools\Base\MapperFactory
;
18
use stdClass;
19
23
final
class
VariantImagesSetMessagePayloadModel
extends
JsonObjectModel
implements
VariantImagesSetMessagePayload
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
(
61
?
ProductReference
$product
=
null
,
62
?
ImageCollection
$images
=
null
,
63
?
ImageCollection
$oldImages
=
null
,
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
193
public
function
setOldImages
(?
ImageCollection
$oldImages
): void
194
{
195
$this->oldImages =
$oldImages
;
196
}
197
201
public
function
setStaged
(?
bool
$staged
): void
202
{
203
$this->staged =
$staged
;
204
}
205
}
Commercetools\Api\Models\Common\ImageCollection
Definition
ImageCollection.php:22
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel
Definition
VariantImagesSetMessagePayloadModel.php:24
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel\getStaged
getStaged()
Definition
VariantImagesSetMessagePayloadModel.php:159
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel\setProduct
setProduct(?ProductReference $product)
Definition
VariantImagesSetMessagePayloadModel.php:177
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel\getOldImages
getOldImages()
Definition
VariantImagesSetMessagePayloadModel.php:139
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel\$staged
$staged
Definition
VariantImagesSetMessagePayloadModel.php:54
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel\$type
$type
Definition
VariantImagesSetMessagePayloadModel.php:30
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel\__construct
__construct(?ProductReference $product=null, ?ImageCollection $images=null, ?ImageCollection $oldImages=null, ?bool $staged=null, ?string $type=null)
Definition
VariantImagesSetMessagePayloadModel.php:60
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel\setStaged
setStaged(?bool $staged)
Definition
VariantImagesSetMessagePayloadModel.php:201
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel\getImages
getImages()
Definition
VariantImagesSetMessagePayloadModel.php:119
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel\$images
$images
Definition
VariantImagesSetMessagePayloadModel.php:42
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel\getType
getType()
Definition
VariantImagesSetMessagePayloadModel.php:78
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel\setImages
setImages(?ImageCollection $images)
Definition
VariantImagesSetMessagePayloadModel.php:185
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel\$oldImages
$oldImages
Definition
VariantImagesSetMessagePayloadModel.php:48
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel\$product
$product
Definition
VariantImagesSetMessagePayloadModel.php:36
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
VariantImagesSetMessagePayloadModel.php:25
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel\getProduct
getProduct()
Definition
VariantImagesSetMessagePayloadModel.php:98
Commercetools\Api\Models\Message\VariantImagesSetMessagePayloadModel\setOldImages
setOldImages(?ImageCollection $oldImages)
Definition
VariantImagesSetMessagePayloadModel.php:193
Commercetools\Api\Models\Product\ProductReferenceModel
Definition
ProductReferenceModel.php:23
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition
BaseJsonObject.php:57
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\Api\Models\Message\VariantImagesSetMessagePayload
Definition
VariantImagesSetMessagePayload.php:17
Commercetools\Api\Models\Product\ProductReference
Definition
ProductReference.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Message
Definition
ApprovalFlowApprovedMessage.php:9
Generated by
1.9.8