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
AddProductChangeModel.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\ProductVariantSelection
;
17
use
Commercetools\History\Models\Common\ProductVariantSelectionModel
;
18
use
Commercetools\History\Models\Common\Reference
;
19
use
Commercetools\History\Models\Common\ReferenceModel
;
20
24
final
class
AddProductChangeModel
extends
JsonObjectModel
implements
AddProductChange
25
{
26
27
public
const
DISCRIMINATOR_VALUE
=
'AddProductChange'
;
32
protected
$type
;
33
38
protected
$change
;
39
44
protected
$nextValue
;
45
50
protected
$variantSelection
;
51
52
56
public
function
__construct
(
57
?
string
$change
=
null
,
58
?
Reference
$nextValue
=
null
,
59
?
ProductVariantSelection
$variantSelection
=
null
,
60
?
string
$type
=
null
61
) {
62
$this->change =
$change
;
63
$this->nextValue =
$nextValue
;
64
$this->variantSelection =
$variantSelection
;
65
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
66
}
67
72
public
function
getType
()
73
{
74
if
(is_null($this->type)) {
76
$data = $this->
raw
(self::FIELD_TYPE);
77
if
(is_null($data)) {
78
return
null
;
79
}
80
$this->type = (string) $data;
81
}
82
83
return
$this->type
;
84
}
85
90
public
function
getChange
()
91
{
92
if
(is_null($this->change)) {
94
$data = $this->
raw
(self::FIELD_CHANGE);
95
if
(is_null($data)) {
96
return
null
;
97
}
98
$this->change = (string) $data;
99
}
100
101
return
$this->change
;
102
}
103
110
public
function
getNextValue
()
111
{
112
if
(is_null($this->nextValue)) {
114
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
115
if
(is_null($data)) {
116
return
null
;
117
}
118
119
$this->nextValue = ReferenceModel::of($data);
120
}
121
122
return
$this->nextValue
;
123
}
124
131
public
function
getVariantSelection
()
132
{
133
if
(is_null($this->variantSelection)) {
135
$data = $this->
raw
(self::FIELD_VARIANT_SELECTION);
136
if
(is_null($data)) {
137
return
null
;
138
}
139
140
$this->variantSelection = ProductVariantSelectionModel::of($data);
141
}
142
143
return
$this->variantSelection
;
144
}
145
146
150
public
function
setChange
(?
string
$change
): void
151
{
152
$this->change =
$change
;
153
}
154
158
public
function
setNextValue
(?
Reference
$nextValue
): void
159
{
160
$this->nextValue =
$nextValue
;
161
}
162
166
public
function
setVariantSelection
(?
ProductVariantSelection
$variantSelection
): void
167
{
168
$this->variantSelection =
$variantSelection
;
169
}
170
171
172
173
}
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\AddProductChangeModel
Definition
AddProductChangeModel.php:25
Commercetools\History\Models\Change\AddProductChangeModel\$type
$type
Definition
AddProductChangeModel.php:32
Commercetools\History\Models\Change\AddProductChangeModel\$change
$change
Definition
AddProductChangeModel.php:38
Commercetools\History\Models\Change\AddProductChangeModel\$variantSelection
$variantSelection
Definition
AddProductChangeModel.php:50
Commercetools\History\Models\Change\AddProductChangeModel\getChange
getChange()
Definition
AddProductChangeModel.php:90
Commercetools\History\Models\Change\AddProductChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
AddProductChangeModel.php:27
Commercetools\History\Models\Change\AddProductChangeModel\getNextValue
getNextValue()
Definition
AddProductChangeModel.php:110
Commercetools\History\Models\Change\AddProductChangeModel\setVariantSelection
setVariantSelection(?ProductVariantSelection $variantSelection)
Definition
AddProductChangeModel.php:166
Commercetools\History\Models\Change\AddProductChangeModel\setChange
setChange(?string $change)
Definition
AddProductChangeModel.php:150
Commercetools\History\Models\Change\AddProductChangeModel\getVariantSelection
getVariantSelection()
Definition
AddProductChangeModel.php:131
Commercetools\History\Models\Change\AddProductChangeModel\__construct
__construct(?string $change=null, ?Reference $nextValue=null, ?ProductVariantSelection $variantSelection=null, ?string $type=null)
Definition
AddProductChangeModel.php:56
Commercetools\History\Models\Change\AddProductChangeModel\$nextValue
$nextValue
Definition
AddProductChangeModel.php:44
Commercetools\History\Models\Change\AddProductChangeModel\setNextValue
setNextValue(?Reference $nextValue)
Definition
AddProductChangeModel.php:158
Commercetools\History\Models\Change\AddProductChangeModel\getType
getType()
Definition
AddProductChangeModel.php:72
Commercetools\History\Models\Common\ProductVariantSelectionModel
Definition
ProductVariantSelectionModel.php:21
Commercetools\History\Models\Common\ReferenceModel
Definition
ReferenceModel.php:21
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\AddProductChange
Definition
AddProductChange.php:17
Commercetools\History\Models\Common\ProductVariantSelection
Definition
ProductVariantSelection.php:15
Commercetools\History\Models\Common\Reference
Definition
Reference.php:15
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8