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
57
61
public
function
__construct
(
62
?
string
$change
=
null
,
63
?
AssetSourceCollection
$previousValue
=
null
,
64
?
AssetSourceCollection
$nextValue
=
null
,
65
?
AssetChangeValue
$asset
=
null
,
66
?
string
$type
=
null
67
) {
68
$this->change =
$change
;
69
$this->previousValue =
$previousValue
;
70
$this->nextValue =
$nextValue
;
71
$this->asset =
$asset
;
72
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
73
}
74
79
public
function
getType
()
80
{
81
if
(is_null($this->type)) {
83
$data = $this->
raw
(self::FIELD_TYPE);
84
if
(is_null($data)) {
85
return
null
;
86
}
87
$this->type = (string) $data;
88
}
89
90
return
$this->type
;
91
}
92
97
public
function
getChange
()
98
{
99
if
(is_null($this->change)) {
101
$data = $this->
raw
(self::FIELD_CHANGE);
102
if
(is_null($data)) {
103
return
null
;
104
}
105
$this->change = (string) $data;
106
}
107
108
return
$this->change
;
109
}
110
117
public
function
getPreviousValue
()
118
{
119
if
(is_null($this->previousValue)) {
121
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
122
if
(is_null($data)) {
123
return
null
;
124
}
125
$this->previousValue = AssetSourceCollection::fromArray($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
$this->nextValue = AssetSourceCollection::fromArray($data);
146
}
147
148
return
$this->nextValue
;
149
}
150
157
public
function
getAsset
()
158
{
159
if
(is_null($this->asset)) {
161
$data = $this->
raw
(self::FIELD_ASSET);
162
if
(is_null($data)) {
163
return
null
;
164
}
165
166
$this->asset = AssetChangeValueModel::of($data);
167
}
168
169
return
$this->asset
;
170
}
171
172
176
public
function
setChange
(?
string
$change
): void
177
{
178
$this->change =
$change
;
179
}
180
184
public
function
setPreviousValue
(?
AssetSourceCollection
$previousValue
): void
185
{
186
$this->previousValue =
$previousValue
;
187
}
188
192
public
function
setNextValue
(?
AssetSourceCollection
$nextValue
): void
193
{
194
$this->nextValue =
$nextValue
;
195
}
196
200
public
function
setAsset
(?
AssetChangeValue
$asset
): void
201
{
202
$this->asset =
$asset
;
203
}
204
205
206
207
}
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:157
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\setAsset
setAsset(?AssetChangeValue $asset)
Definition
SetAssetSourcesChangeModel.php:200
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\__construct
__construct(?string $change=null, ?AssetSourceCollection $previousValue=null, ?AssetSourceCollection $nextValue=null, ?AssetChangeValue $asset=null, ?string $type=null)
Definition
SetAssetSourcesChangeModel.php:61
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\$previousValue
$previousValue
Definition
SetAssetSourcesChangeModel.php:43
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\setChange
setChange(?string $change)
Definition
SetAssetSourcesChangeModel.php:176
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:192
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\$nextValue
$nextValue
Definition
SetAssetSourcesChangeModel.php:49
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\getChange
getChange()
Definition
SetAssetSourcesChangeModel.php:97
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\$type
$type
Definition
SetAssetSourcesChangeModel.php:31
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\getPreviousValue
getPreviousValue()
Definition
SetAssetSourcesChangeModel.php:117
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\setPreviousValue
setPreviousValue(?AssetSourceCollection $previousValue)
Definition
SetAssetSourcesChangeModel.php:184
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\$asset
$asset
Definition
SetAssetSourcesChangeModel.php:55
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\getType
getType()
Definition
SetAssetSourcesChangeModel.php:79
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\getNextValue
getNextValue()
Definition
SetAssetSourcesChangeModel.php:137
Commercetools\History\Models\Change\SetAssetSourcesChangeModel\$change
$change
Definition
SetAssetSourcesChangeModel.php:37
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