commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-history
src
Models
Change
AddVariantChangeModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\History\Models\Change
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use stdClass;
16
use
Commercetools\History\Models\Common\Variant
;
17
use
Commercetools\History\Models\Common\VariantModel
;
18
22
final
class
AddVariantChangeModel
extends
JsonObjectModel
implements
AddVariantChange
23
{
24
25
public
const
DISCRIMINATOR_VALUE
=
'AddVariantChange'
;
30
protected
$type
;
31
36
protected
$change
;
37
42
protected
$previousValue
;
43
48
protected
$nextValue
;
49
54
protected
$catalogData
;
55
56
60
public
function
__construct
(
61
?
string
$change
=
null
,
62
?
Variant
$previousValue
=
null
,
63
?
Variant
$nextValue
=
null
,
64
?
string
$catalogData
=
null
,
65
?
string
$type
=
null
66
) {
67
$this->change =
$change
;
68
$this->previousValue =
$previousValue
;
69
$this->nextValue =
$nextValue
;
70
$this->catalogData =
$catalogData
;
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
96
public
function
getChange
()
97
{
98
if
(is_null($this->change)) {
100
$data = $this->
raw
(self::FIELD_CHANGE);
101
if
(is_null($data)) {
102
return
null
;
103
}
104
$this->change = (string) $data;
105
}
106
107
return
$this->change
;
108
}
109
116
public
function
getPreviousValue
()
117
{
118
if
(is_null($this->previousValue)) {
120
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
121
if
(is_null($data)) {
122
return
null
;
123
}
124
125
$this->previousValue = VariantModel::of($data);
126
}
127
128
return
$this->previousValue
;
129
}
130
137
public
function
getNextValue
()
138
{
139
if
(is_null($this->nextValue)) {
141
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
142
if
(is_null($data)) {
143
return
null
;
144
}
145
146
$this->nextValue = VariantModel::of($data);
147
}
148
149
return
$this->nextValue
;
150
}
151
161
public
function
getCatalogData
()
162
{
163
if
(is_null($this->catalogData)) {
165
$data = $this->
raw
(self::FIELD_CATALOG_DATA);
166
if
(is_null($data)) {
167
return
null
;
168
}
169
$this->catalogData = (string) $data;
170
}
171
172
return
$this->catalogData
;
173
}
174
175
179
public
function
setChange
(?
string
$change
): void
180
{
181
$this->change =
$change
;
182
}
183
187
public
function
setPreviousValue
(?
Variant
$previousValue
): void
188
{
189
$this->previousValue =
$previousValue
;
190
}
191
195
public
function
setNextValue
(?
Variant
$nextValue
): void
196
{
197
$this->nextValue =
$nextValue
;
198
}
199
203
public
function
setCatalogData
(?
string
$catalogData
): void
204
{
205
$this->catalogData =
$catalogData
;
206
}
207
208
209
210
}
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\History\Models\Change\AddVariantChangeModel
Definition
AddVariantChangeModel.php:23
Commercetools\History\Models\Change\AddVariantChangeModel\setPreviousValue
setPreviousValue(?Variant $previousValue)
Definition
AddVariantChangeModel.php:187
Commercetools\History\Models\Change\AddVariantChangeModel\getType
getType()
Definition
AddVariantChangeModel.php:78
Commercetools\History\Models\Change\AddVariantChangeModel\__construct
__construct(?string $change=null, ?Variant $previousValue=null, ?Variant $nextValue=null, ?string $catalogData=null, ?string $type=null)
Definition
AddVariantChangeModel.php:60
Commercetools\History\Models\Change\AddVariantChangeModel\$nextValue
$nextValue
Definition
AddVariantChangeModel.php:48
Commercetools\History\Models\Change\AddVariantChangeModel\$previousValue
$previousValue
Definition
AddVariantChangeModel.php:42
Commercetools\History\Models\Change\AddVariantChangeModel\setChange
setChange(?string $change)
Definition
AddVariantChangeModel.php:179
Commercetools\History\Models\Change\AddVariantChangeModel\$type
$type
Definition
AddVariantChangeModel.php:30
Commercetools\History\Models\Change\AddVariantChangeModel\getCatalogData
getCatalogData()
Definition
AddVariantChangeModel.php:161
Commercetools\History\Models\Change\AddVariantChangeModel\setCatalogData
setCatalogData(?string $catalogData)
Definition
AddVariantChangeModel.php:203
Commercetools\History\Models\Change\AddVariantChangeModel\$change
$change
Definition
AddVariantChangeModel.php:36
Commercetools\History\Models\Change\AddVariantChangeModel\getNextValue
getNextValue()
Definition
AddVariantChangeModel.php:137
Commercetools\History\Models\Change\AddVariantChangeModel\setNextValue
setNextValue(?Variant $nextValue)
Definition
AddVariantChangeModel.php:195
Commercetools\History\Models\Change\AddVariantChangeModel\$catalogData
$catalogData
Definition
AddVariantChangeModel.php:54
Commercetools\History\Models\Change\AddVariantChangeModel\getPreviousValue
getPreviousValue()
Definition
AddVariantChangeModel.php:116
Commercetools\History\Models\Change\AddVariantChangeModel\getChange
getChange()
Definition
AddVariantChangeModel.php:96
Commercetools\History\Models\Change\AddVariantChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
AddVariantChangeModel.php:25
Commercetools\History\Models\Common\VariantModel
Definition
VariantModel.php:21
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\AddVariantChange
Definition
AddVariantChange.php:16
Commercetools\History\Models\Common\Variant
Definition
Variant.php:15
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8