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
SetAssetSourcesChangeModel.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\ChangeValue\AssetChangeValue
;
17
use
Commercetools\History\Models\ChangeValue\AssetChangeValueModel
;
18
use
Commercetools\History\Models\Common\AssetSourceCollection
;
19
23
final
class
SetAssetSourcesChangeModel
extends
JsonObjectModel
implements
SetAssetSourcesChange
24
{
25
26
public
const
DISCRIMINATOR_VALUE
=
'SetAssetSourcesChange'
;
31
protected
$type
;
32
37
protected
$change
;
38
43
protected
$previousValue
;
44
49
protected
$nextValue
;
50
55
protected
$asset
;
56
61
protected
$catalogData
;
62
67
protected
$variant
;
68
69
73
public
function
__construct
(
74
?
string
$change
=
null
,
75
?
AssetSourceCollection
$previousValue
=
null
,
76
?
AssetSourceCollection
$nextValue
=
null
,
77
?
AssetChangeValue
$asset
=
null
,
78
?
string
$catalogData
=
null
,
79
?
string
$variant
=
null
,
80
?
string
$type
=
null
81
) {
82
$this->change =
$change
;
83
$this->previousValue =
$previousValue
;
84
$this->nextValue =
$nextValue
;
85
$this->asset =
$asset
;
86
$this->catalogData =
$catalogData
;
87
$this->variant =
$variant
;
88
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
89
}
90
95
public
function
getType
()
96
{
97
if
(is_null($this->type)) {
99
$data = $this->
raw
(self::FIELD_TYPE);
100
if
(is_null($data)) {
101
return
null
;
102
}
103
$this->type = (string) $data;
104
}
105
106
return
$this->type
;
107
}
108
113
public
function
getChange
()
114
{
115
if
(is_null($this->change)) {
117
$data = $this->
raw
(self::FIELD_CHANGE);
118
if
(is_null($data)) {
119
return
null
;
120
}
121
$this->change = (string) $data;
122
}
123
124
return
$this->change
;
125
}
126
133
public
function
getPreviousValue
()
134
{
135
if
(is_null($this->previousValue)) {
137
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
138
if
(is_null($data)) {
139
return
null
;
140
}
141
$this->previousValue = AssetSourceCollection::fromArray($data);
142
}
143
144
return
$this->previousValue
;
145
}
146
153
public
function
getNextValue
()
154
{
155
if
(is_null($this->nextValue)) {
157
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
158
if
(is_null($data)) {
159
return
null
;
160
}
161
$this->nextValue = AssetSourceCollection::fromArray($data);
162
}
163
164
return
$this->nextValue
;
165
}
166
173
public
function
getAsset
()
174
{
175
if
(is_null($this->asset)) {
177
$data = $this->
raw
(self::FIELD_ASSET);
178
if
(is_null($data)) {
179
return
null
;
180
}
181
182
$this->asset = AssetChangeValueModel::of($data);
183
}
184
185
return
$this->asset
;
186
}
187
198
public
function
getCatalogData
()
199
{
200
if
(is_null($this->catalogData)) {
202
$data = $this->
raw
(self::FIELD_CATALOG_DATA);
203
if
(is_null($data)) {
204
return
null
;
205
}
206
$this->catalogData = (string) $data;
207
}
208
209
return
$this->catalogData
;
210
}
211
219
public
function
getVariant
()
220
{
221
if
(is_null($this->variant)) {
223
$data = $this->
raw
(self::FIELD_VARIANT);
224
if
(is_null($data)) {
225
return
null
;
226
}
227
$this->variant = (string) $data;
228
}
229
230
return
$this->variant
;
231
}
232
233
237
public
function
setChange
(?
string
$change
): void
238
{
239
$this->change =
$change
;
240
}
241
245
public
function
setPreviousValue
(?
AssetSourceCollection
$previousValue
): void
246
{
247
$this->previousValue =
$previousValue
;
248
}
249
253
public
function
setNextValue
(?
AssetSourceCollection
$nextValue
): void
254
{
255
$this->nextValue =
$nextValue
;
256
}
257
261
public
function
setAsset
(?
AssetChangeValue
$asset
): void
262
{
263
$this->asset =
$asset
;
264
}
265
269
public
function
setCatalogData
(?
string
$catalogData
): void
270
{
271
$this->catalogData =
$catalogData
;
272
}
273
277
public
function
setVariant
(?
string
$variant
): void
278
{
279
$this->variant =
$variant
;
280
}
281
282
283
284
}
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\SetAssetSourcesChangeModel
Definition
SetAssetSourcesChangeModel.php:24
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\getAsset
getAsset()
Definition
SetAssetSourcesChangeModel.php:173
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\$variant
$variant
Definition
SetAssetSourcesChangeModel.php:67
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\setAsset
setAsset(?AssetChangeValue $asset)
Definition
SetAssetSourcesChangeModel.php:261
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\$previousValue
$previousValue
Definition
SetAssetSourcesChangeModel.php:43
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\setChange
setChange(?string $change)
Definition
SetAssetSourcesChangeModel.php:237
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
SetAssetSourcesChangeModel.php:26
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\setNextValue
setNextValue(?AssetSourceCollection $nextValue)
Definition
SetAssetSourcesChangeModel.php:253
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\getVariant
getVariant()
Definition
SetAssetSourcesChangeModel.php:219
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\$nextValue
$nextValue
Definition
SetAssetSourcesChangeModel.php:49
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\getChange
getChange()
Definition
SetAssetSourcesChangeModel.php:113
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\$type
$type
Definition
SetAssetSourcesChangeModel.php:31
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\getPreviousValue
getPreviousValue()
Definition
SetAssetSourcesChangeModel.php:133
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\setPreviousValue
setPreviousValue(?AssetSourceCollection $previousValue)
Definition
SetAssetSourcesChangeModel.php:245
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\$asset
$asset
Definition
SetAssetSourcesChangeModel.php:55
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\setVariant
setVariant(?string $variant)
Definition
SetAssetSourcesChangeModel.php:277
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\getType
getType()
Definition
SetAssetSourcesChangeModel.php:95
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\$catalogData
$catalogData
Definition
SetAssetSourcesChangeModel.php:61
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\getCatalogData
getCatalogData()
Definition
SetAssetSourcesChangeModel.php:198
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\__construct
__construct(?string $change=null, ?AssetSourceCollection $previousValue=null, ?AssetSourceCollection $nextValue=null, ?AssetChangeValue $asset=null, ?string $catalogData=null, ?string $variant=null, ?string $type=null)
Definition
SetAssetSourcesChangeModel.php:73
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\getNextValue
getNextValue()
Definition
SetAssetSourcesChangeModel.php:153
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\$change
$change
Definition
SetAssetSourcesChangeModel.php:37
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\setCatalogData
setCatalogData(?string $catalogData)
Definition
SetAssetSourcesChangeModel.php:269
Commercetools\History\Models\ChangeValue\AssetChangeValueModel
Definition
AssetChangeValueModel.php:23
Commercetools\History\Models\Common\AssetSourceCollection
Definition
AssetSourceCollection.php:22
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\SetAssetSourcesChange
Definition
SetAssetSourcesChange.php:17
Commercetools\History\Models\ChangeValue\AssetChangeValue
Definition
AssetChangeValue.php:16
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8