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
SetStoresChangeModel.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\ReferenceCollection
;
17
21
final
class
SetStoresChangeModel
extends
JsonObjectModel
implements
SetStoresChange
22
{
23
24
public
const
DISCRIMINATOR_VALUE
=
'SetStoresChange'
;
29
protected
$type
;
30
35
protected
$change
;
36
41
protected
$previousValue
;
42
47
protected
$nextValue
;
48
49
53
public
function
__construct
(
54
?
string
$change
=
null
,
55
?
ReferenceCollection
$previousValue
=
null
,
56
?
ReferenceCollection
$nextValue
=
null
,
57
?
string
$type
=
null
58
) {
59
$this->change =
$change
;
60
$this->previousValue =
$previousValue
;
61
$this->nextValue =
$nextValue
;
62
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
63
}
64
69
public
function
getType
()
70
{
71
if
(is_null($this->type)) {
73
$data = $this->
raw
(self::FIELD_TYPE);
74
if
(is_null($data)) {
75
return
null
;
76
}
77
$this->type = (string) $data;
78
}
79
80
return
$this->type
;
81
}
82
87
public
function
getChange
()
88
{
89
if
(is_null($this->change)) {
91
$data = $this->
raw
(self::FIELD_CHANGE);
92
if
(is_null($data)) {
93
return
null
;
94
}
95
$this->change = (string) $data;
96
}
97
98
return
$this->change
;
99
}
100
107
public
function
getPreviousValue
()
108
{
109
if
(is_null($this->previousValue)) {
111
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
112
if
(is_null($data)) {
113
return
null
;
114
}
115
$this->previousValue = ReferenceCollection::fromArray($data);
116
}
117
118
return
$this->previousValue
;
119
}
120
127
public
function
getNextValue
()
128
{
129
if
(is_null($this->nextValue)) {
131
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
132
if
(is_null($data)) {
133
return
null
;
134
}
135
$this->nextValue = ReferenceCollection::fromArray($data);
136
}
137
138
return
$this->nextValue
;
139
}
140
141
145
public
function
setChange
(?
string
$change
): void
146
{
147
$this->change =
$change
;
148
}
149
153
public
function
setPreviousValue
(?
ReferenceCollection
$previousValue
): void
154
{
155
$this->previousValue =
$previousValue
;
156
}
157
161
public
function
setNextValue
(?
ReferenceCollection
$nextValue
): void
162
{
163
$this->nextValue =
$nextValue
;
164
}
165
166
167
168
}
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\SetStoresChangeModel
Definition
SetStoresChangeModel.php:22
Commercetools\History\Models\Change\SetStoresChangeModel\getNextValue
getNextValue()
Definition
SetStoresChangeModel.php:127
Commercetools\History\Models\Change\SetStoresChangeModel\__construct
__construct(?string $change=null, ?ReferenceCollection $previousValue=null, ?ReferenceCollection $nextValue=null, ?string $type=null)
Definition
SetStoresChangeModel.php:53
Commercetools\History\Models\Change\SetStoresChangeModel\getPreviousValue
getPreviousValue()
Definition
SetStoresChangeModel.php:107
Commercetools\History\Models\Change\SetStoresChangeModel\getChange
getChange()
Definition
SetStoresChangeModel.php:87
Commercetools\History\Models\Change\SetStoresChangeModel\$change
$change
Definition
SetStoresChangeModel.php:35
Commercetools\History\Models\Change\SetStoresChangeModel\$nextValue
$nextValue
Definition
SetStoresChangeModel.php:47
Commercetools\History\Models\Change\SetStoresChangeModel\setChange
setChange(?string $change)
Definition
SetStoresChangeModel.php:145
Commercetools\History\Models\Change\SetStoresChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
SetStoresChangeModel.php:24
Commercetools\History\Models\Change\SetStoresChangeModel\$type
$type
Definition
SetStoresChangeModel.php:29
Commercetools\History\Models\Change\SetStoresChangeModel\setPreviousValue
setPreviousValue(?ReferenceCollection $previousValue)
Definition
SetStoresChangeModel.php:153
Commercetools\History\Models\Change\SetStoresChangeModel\$previousValue
$previousValue
Definition
SetStoresChangeModel.php:41
Commercetools\History\Models\Change\SetStoresChangeModel\getType
getType()
Definition
SetStoresChangeModel.php:69
Commercetools\History\Models\Change\SetStoresChangeModel\setNextValue
setNextValue(?ReferenceCollection $nextValue)
Definition
SetStoresChangeModel.php:161
Commercetools\History\Models\Common\ReferenceCollection
Definition
ReferenceCollection.php:22
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\SetStoresChange
Definition
SetStoresChange.php:16
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8