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
ExcludeProductChangeModel.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\ProductVariantExclusion
;
17
use
Commercetools\History\Models\Common\ProductVariantExclusionModel
;
18
use
Commercetools\History\Models\Common\Reference
;
19
use
Commercetools\History\Models\Common\ReferenceModel
;
20
24
final
class
ExcludeProductChangeModel
extends
JsonObjectModel
implements
ExcludeProductChange
25
{
26
27
public
const
DISCRIMINATOR_VALUE
=
'ExcludeProductChange'
;
32
protected
$type
;
33
38
protected
$change
;
39
44
protected
$variantExclusion
;
45
50
protected
$nextValue
;
51
52
56
public
function
__construct
(
57
?
string
$change
=
null
,
58
?
ProductVariantExclusion
$variantExclusion
=
null
,
59
?
Reference
$nextValue
=
null
,
60
?
string
$type
=
null
61
) {
62
$this->change =
$change
;
63
$this->variantExclusion =
$variantExclusion
;
64
$this->nextValue =
$nextValue
;
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
getVariantExclusion
()
111
{
112
if
(is_null($this->variantExclusion)) {
114
$data = $this->
raw
(self::FIELD_VARIANT_EXCLUSION);
115
if
(is_null($data)) {
116
return
null
;
117
}
118
119
$this->variantExclusion = ProductVariantExclusionModel::of($data);
120
}
121
122
return
$this->variantExclusion
;
123
}
124
131
public
function
getNextValue
()
132
{
133
if
(is_null($this->nextValue)) {
135
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
136
if
(is_null($data)) {
137
return
null
;
138
}
139
$className = ReferenceModel::resolveDiscriminatorClass($data);
140
$this->nextValue = $className::of($data);
141
}
142
143
return
$this->nextValue
;
144
}
145
146
150
public
function
setChange
(?
string
$change
): void
151
{
152
$this->change =
$change
;
153
}
154
158
public
function
setVariantExclusion
(?
ProductVariantExclusion
$variantExclusion
): void
159
{
160
$this->variantExclusion =
$variantExclusion
;
161
}
162
166
public
function
setNextValue
(?
Reference
$nextValue
): void
167
{
168
$this->nextValue =
$nextValue
;
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\ExcludeProductChangeModel
Definition
ExcludeProductChangeModel.php:25
Commercetools\History\Models\Change\ExcludeProductChangeModel\$variantExclusion
$variantExclusion
Definition
ExcludeProductChangeModel.php:44
Commercetools\History\Models\Change\ExcludeProductChangeModel\getNextValue
getNextValue()
Definition
ExcludeProductChangeModel.php:131
Commercetools\History\Models\Change\ExcludeProductChangeModel\$nextValue
$nextValue
Definition
ExcludeProductChangeModel.php:50
Commercetools\History\Models\Change\ExcludeProductChangeModel\__construct
__construct(?string $change=null, ?ProductVariantExclusion $variantExclusion=null, ?Reference $nextValue=null, ?string $type=null)
Definition
ExcludeProductChangeModel.php:56
Commercetools\History\Models\Change\ExcludeProductChangeModel\$change
$change
Definition
ExcludeProductChangeModel.php:38
Commercetools\History\Models\Change\ExcludeProductChangeModel\setChange
setChange(?string $change)
Definition
ExcludeProductChangeModel.php:150
Commercetools\History\Models\Change\ExcludeProductChangeModel\setNextValue
setNextValue(?Reference $nextValue)
Definition
ExcludeProductChangeModel.php:166
Commercetools\History\Models\Change\ExcludeProductChangeModel\getChange
getChange()
Definition
ExcludeProductChangeModel.php:90
Commercetools\History\Models\Change\ExcludeProductChangeModel\setVariantExclusion
setVariantExclusion(?ProductVariantExclusion $variantExclusion)
Definition
ExcludeProductChangeModel.php:158
Commercetools\History\Models\Change\ExcludeProductChangeModel\getVariantExclusion
getVariantExclusion()
Definition
ExcludeProductChangeModel.php:110
Commercetools\History\Models\Change\ExcludeProductChangeModel\$type
$type
Definition
ExcludeProductChangeModel.php:32
Commercetools\History\Models\Change\ExcludeProductChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
ExcludeProductChangeModel.php:27
Commercetools\History\Models\Change\ExcludeProductChangeModel\getType
getType()
Definition
ExcludeProductChangeModel.php:72
Commercetools\History\Models\Common\ProductVariantExclusionModel
Definition
ProductVariantExclusionModel.php:21
Commercetools\History\Models\Common\ReferenceModel
Definition
ReferenceModel.php:21
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\ExcludeProductChange
Definition
ExcludeProductChange.php:17
Commercetools\History\Models\Common\ProductVariantExclusion
Definition
ProductVariantExclusion.php:15
Commercetools\History\Models\Common\Reference
Definition
Reference.php:15
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8