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
VariantKeySetMessagePayloadModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Message
;
10
11
use
Commercetools\Api\Models\Product\ProductReference
;
12
use
Commercetools\Api\Models\Product\ProductReferenceModel
;
13
use
Commercetools\Base\DateTimeImmutableCollection
;
14
use
Commercetools\Base\JsonObject
;
15
use
Commercetools\Base\JsonObjectModel
;
16
use
Commercetools\Base\MapperFactory
;
17
use stdClass;
18
22
final
class
VariantKeySetMessagePayloadModel
extends
JsonObjectModel
implements
VariantKeySetMessagePayload
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'VariantKeySet'
;
29
protected
$type
;
30
35
protected
$product
;
36
41
protected
$key
;
42
47
protected
$oldKey
;
48
49
53
public
function
__construct
(
54
?
ProductReference
$product
=
null
,
55
?
string
$key
=
null
,
56
?
string
$oldKey
=
null
,
57
?
string
$type
=
null
58
) {
59
$this->product =
$product
;
60
$this->key =
$key
;
61
$this->oldKey =
$oldKey
;
62
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
63
}
64
69
public
function
getType
()
70
{
71
if
(is_null($this->type)) {
73
$data = $this->
raw
(self::FIELD_TYPE);
74
if
(is_null($data)) {
75
return
null
;
76
}
77
$this->type = (string) $data;
78
}
79
80
return
$this->type
;
81
}
82
89
public
function
getProduct
()
90
{
91
if
(is_null($this->product)) {
93
$data = $this->
raw
(self::FIELD_PRODUCT);
94
if
(is_null($data)) {
95
return
null
;
96
}
97
98
$this->product = ProductReferenceModel::of($data);
99
}
100
101
return
$this->product
;
102
}
103
110
public
function
getKey
()
111
{
112
if
(is_null($this->key)) {
114
$data = $this->
raw
(self::FIELD_KEY);
115
if
(is_null($data)) {
116
return
null
;
117
}
118
$this->key = (string) $data;
119
}
120
121
return
$this->key
;
122
}
123
130
public
function
getOldKey
()
131
{
132
if
(is_null($this->oldKey)) {
134
$data = $this->
raw
(self::FIELD_OLD_KEY);
135
if
(is_null($data)) {
136
return
null
;
137
}
138
$this->oldKey = (string) $data;
139
}
140
141
return
$this->oldKey
;
142
}
143
144
148
public
function
setProduct
(?
ProductReference
$product
): void
149
{
150
$this->product =
$product
;
151
}
152
156
public
function
setKey
(?
string
$key
): void
157
{
158
$this->key =
$key
;
159
}
160
164
public
function
setOldKey
(?
string
$oldKey
): void
165
{
166
$this->oldKey =
$oldKey
;
167
}
168
}
Commercetools\Api\Models\Message\VariantKeySetMessagePayloadModel
Definition
VariantKeySetMessagePayloadModel.php:23
Commercetools\Api\Models\Message\VariantKeySetMessagePayloadModel\$type
$type
Definition
VariantKeySetMessagePayloadModel.php:29
Commercetools\Api\Models\Message\VariantKeySetMessagePayloadModel\$oldKey
$oldKey
Definition
VariantKeySetMessagePayloadModel.php:47
Commercetools\Api\Models\Message\VariantKeySetMessagePayloadModel\$product
$product
Definition
VariantKeySetMessagePayloadModel.php:35
Commercetools\Api\Models\Message\VariantKeySetMessagePayloadModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
VariantKeySetMessagePayloadModel.php:24
Commercetools\Api\Models\Message\VariantKeySetMessagePayloadModel\__construct
__construct(?ProductReference $product=null, ?string $key=null, ?string $oldKey=null, ?string $type=null)
Definition
VariantKeySetMessagePayloadModel.php:53
Commercetools\Api\Models\Message\VariantKeySetMessagePayloadModel\getProduct
getProduct()
Definition
VariantKeySetMessagePayloadModel.php:89
Commercetools\Api\Models\Message\VariantKeySetMessagePayloadModel\setProduct
setProduct(?ProductReference $product)
Definition
VariantKeySetMessagePayloadModel.php:148
Commercetools\Api\Models\Message\VariantKeySetMessagePayloadModel\getKey
getKey()
Definition
VariantKeySetMessagePayloadModel.php:110
Commercetools\Api\Models\Message\VariantKeySetMessagePayloadModel\getOldKey
getOldKey()
Definition
VariantKeySetMessagePayloadModel.php:130
Commercetools\Api\Models\Message\VariantKeySetMessagePayloadModel\getType
getType()
Definition
VariantKeySetMessagePayloadModel.php:69
Commercetools\Api\Models\Message\VariantKeySetMessagePayloadModel\$key
$key
Definition
VariantKeySetMessagePayloadModel.php:41
Commercetools\Api\Models\Message\VariantKeySetMessagePayloadModel\setKey
setKey(?string $key)
Definition
VariantKeySetMessagePayloadModel.php:156
Commercetools\Api\Models\Message\VariantKeySetMessagePayloadModel\setOldKey
setOldKey(?string $oldKey)
Definition
VariantKeySetMessagePayloadModel.php:164
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\VariantKeySetMessagePayload
Definition
VariantKeySetMessagePayload.php:16
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