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
SetAncestorsChangeModel.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
SetAncestorsChangeModel
extends
JsonObjectModel
implements
SetAncestorsChange
22
{
23
24
public
const
DISCRIMINATOR_VALUE
=
'SetAncestorsChange'
;
29
protected
$type
;
30
35
protected
$change
;
36
41
protected
$addedItems
;
42
47
protected
$removedItems
;
48
53
protected
$previousValue
;
54
59
protected
$nextValue
;
60
61
65
public
function
__construct
(
66
?
string
$change
=
null
,
67
?
ReferenceCollection
$addedItems
=
null
,
68
?
ReferenceCollection
$removedItems
=
null
,
69
?
ReferenceCollection
$previousValue
=
null
,
70
?
ReferenceCollection
$nextValue
=
null
,
71
?
string
$type
=
null
72
) {
73
$this->change =
$change
;
74
$this->addedItems =
$addedItems
;
75
$this->removedItems =
$removedItems
;
76
$this->previousValue =
$previousValue
;
77
$this->nextValue =
$nextValue
;
78
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
79
}
80
85
public
function
getType
()
86
{
87
if
(is_null($this->type)) {
89
$data = $this->
raw
(self::FIELD_TYPE);
90
if
(is_null($data)) {
91
return
null
;
92
}
93
$this->type = (string) $data;
94
}
95
96
return
$this->type
;
97
}
98
103
public
function
getChange
()
104
{
105
if
(is_null($this->change)) {
107
$data = $this->
raw
(self::FIELD_CHANGE);
108
if
(is_null($data)) {
109
return
null
;
110
}
111
$this->change = (string) $data;
112
}
113
114
return
$this->change
;
115
}
116
123
public
function
getAddedItems
()
124
{
125
if
(is_null($this->addedItems)) {
127
$data = $this->
raw
(self::FIELD_ADDED_ITEMS);
128
if
(is_null($data)) {
129
return
null
;
130
}
131
$this->addedItems = ReferenceCollection::fromArray($data);
132
}
133
134
return
$this->addedItems
;
135
}
136
143
public
function
getRemovedItems
()
144
{
145
if
(is_null($this->removedItems)) {
147
$data = $this->
raw
(self::FIELD_REMOVED_ITEMS);
148
if
(is_null($data)) {
149
return
null
;
150
}
151
$this->removedItems = ReferenceCollection::fromArray($data);
152
}
153
154
return
$this->removedItems
;
155
}
156
163
public
function
getPreviousValue
()
164
{
165
if
(is_null($this->previousValue)) {
167
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
168
if
(is_null($data)) {
169
return
null
;
170
}
171
$this->previousValue = ReferenceCollection::fromArray($data);
172
}
173
174
return
$this->previousValue
;
175
}
176
183
public
function
getNextValue
()
184
{
185
if
(is_null($this->nextValue)) {
187
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
188
if
(is_null($data)) {
189
return
null
;
190
}
191
$this->nextValue = ReferenceCollection::fromArray($data);
192
}
193
194
return
$this->nextValue
;
195
}
196
197
201
public
function
setChange
(?
string
$change
): void
202
{
203
$this->change =
$change
;
204
}
205
209
public
function
setAddedItems
(?
ReferenceCollection
$addedItems
): void
210
{
211
$this->addedItems =
$addedItems
;
212
}
213
217
public
function
setRemovedItems
(?
ReferenceCollection
$removedItems
): void
218
{
219
$this->removedItems =
$removedItems
;
220
}
221
225
public
function
setPreviousValue
(?
ReferenceCollection
$previousValue
): void
226
{
227
$this->previousValue =
$previousValue
;
228
}
229
233
public
function
setNextValue
(?
ReferenceCollection
$nextValue
): void
234
{
235
$this->nextValue =
$nextValue
;
236
}
237
238
239
240
}
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\SetAncestorsChangeModel
Definition
SetAncestorsChangeModel.php:22
Commercetools\History\Models\Change\SetAncestorsChangeModel\setChange
setChange(?string $change)
Definition
SetAncestorsChangeModel.php:201
Commercetools\History\Models\Change\SetAncestorsChangeModel\getRemovedItems
getRemovedItems()
Definition
SetAncestorsChangeModel.php:143
Commercetools\History\Models\Change\SetAncestorsChangeModel\$nextValue
$nextValue
Definition
SetAncestorsChangeModel.php:59
Commercetools\History\Models\Change\SetAncestorsChangeModel\getNextValue
getNextValue()
Definition
SetAncestorsChangeModel.php:183
Commercetools\History\Models\Change\SetAncestorsChangeModel\$previousValue
$previousValue
Definition
SetAncestorsChangeModel.php:53
Commercetools\History\Models\Change\SetAncestorsChangeModel\setAddedItems
setAddedItems(?ReferenceCollection $addedItems)
Definition
SetAncestorsChangeModel.php:209
Commercetools\History\Models\Change\SetAncestorsChangeModel\$type
$type
Definition
SetAncestorsChangeModel.php:29
Commercetools\History\Models\Change\SetAncestorsChangeModel\setRemovedItems
setRemovedItems(?ReferenceCollection $removedItems)
Definition
SetAncestorsChangeModel.php:217
Commercetools\History\Models\Change\SetAncestorsChangeModel\getType
getType()
Definition
SetAncestorsChangeModel.php:85
Commercetools\History\Models\Change\SetAncestorsChangeModel\$addedItems
$addedItems
Definition
SetAncestorsChangeModel.php:41
Commercetools\History\Models\Change\SetAncestorsChangeModel\$change
$change
Definition
SetAncestorsChangeModel.php:35
Commercetools\History\Models\Change\SetAncestorsChangeModel\$removedItems
$removedItems
Definition
SetAncestorsChangeModel.php:47
Commercetools\History\Models\Change\SetAncestorsChangeModel\setPreviousValue
setPreviousValue(?ReferenceCollection $previousValue)
Definition
SetAncestorsChangeModel.php:225
Commercetools\History\Models\Change\SetAncestorsChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
SetAncestorsChangeModel.php:24
Commercetools\History\Models\Change\SetAncestorsChangeModel\setNextValue
setNextValue(?ReferenceCollection $nextValue)
Definition
SetAncestorsChangeModel.php:233
Commercetools\History\Models\Change\SetAncestorsChangeModel\getChange
getChange()
Definition
SetAncestorsChangeModel.php:103
Commercetools\History\Models\Change\SetAncestorsChangeModel\getAddedItems
getAddedItems()
Definition
SetAncestorsChangeModel.php:123
Commercetools\History\Models\Change\SetAncestorsChangeModel\__construct
__construct(?string $change=null, ?ReferenceCollection $addedItems=null, ?ReferenceCollection $removedItems=null, ?ReferenceCollection $previousValue=null, ?ReferenceCollection $nextValue=null, ?string $type=null)
Definition
SetAncestorsChangeModel.php:65
Commercetools\History\Models\Change\SetAncestorsChangeModel\getPreviousValue
getPreviousValue()
Definition
SetAncestorsChangeModel.php:163
Commercetools\History\Models\Common\ReferenceCollection
Definition
ReferenceCollection.php:26
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\SetAncestorsChange
Definition
SetAncestorsChange.php:16
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8