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
SetCustomFieldChangeModel.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
20
final
class
SetCustomFieldChangeModel
extends
JsonObjectModel
implements
SetCustomFieldChange
21
{
22
23
public
const
DISCRIMINATOR_VALUE
=
'SetCustomFieldChange'
;
28
protected
$type
;
29
34
protected
$change
;
35
40
protected
$previousValue
;
41
46
protected
$nextValue
;
47
52
protected
$name
;
53
58
protected
$customTypeId
;
59
60
64
public
function
__construct
(
65
?
string
$change
=
null
,
66
$previousValue
=
null
,
67
$nextValue
=
null
,
68
?
string
$name
=
null
,
69
?
string
$customTypeId
=
null
,
70
?
string
$type
=
null
71
) {
72
$this->change =
$change
;
73
$this->previousValue =
$previousValue
;
74
$this->nextValue =
$nextValue
;
75
$this->name =
$name
;
76
$this->customTypeId =
$customTypeId
;
77
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
78
}
79
84
public
function
getType
()
85
{
86
if
(is_null($this->type)) {
88
$data = $this->
raw
(self::FIELD_TYPE);
89
if
(is_null($data)) {
90
return
null
;
91
}
92
$this->type = (string) $data;
93
}
94
95
return
$this->type
;
96
}
97
102
public
function
getChange
()
103
{
104
if
(is_null($this->change)) {
106
$data = $this->
raw
(self::FIELD_CHANGE);
107
if
(is_null($data)) {
108
return
null
;
109
}
110
$this->change = (string) $data;
111
}
112
113
return
$this->change
;
114
}
115
122
public
function
getPreviousValue
()
123
{
124
if
(is_null($this->previousValue)) {
126
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
127
if
(is_null($data)) {
128
return
null
;
129
}
130
$this->previousValue = $data;
131
}
132
133
return
$this->previousValue
;
134
}
135
142
public
function
getNextValue
()
143
{
144
if
(is_null($this->nextValue)) {
146
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
147
if
(is_null($data)) {
148
return
null
;
149
}
150
$this->nextValue = $data;
151
}
152
153
return
$this->nextValue
;
154
}
155
162
public
function
getName
()
163
{
164
if
(is_null($this->name)) {
166
$data = $this->
raw
(self::FIELD_NAME);
167
if
(is_null($data)) {
168
return
null
;
169
}
170
$this->name = (string) $data;
171
}
172
173
return
$this->name
;
174
}
175
182
public
function
getCustomTypeId
()
183
{
184
if
(is_null($this->customTypeId)) {
186
$data = $this->
raw
(self::FIELD_CUSTOM_TYPE_ID);
187
if
(is_null($data)) {
188
return
null
;
189
}
190
$this->customTypeId = (string) $data;
191
}
192
193
return
$this->customTypeId
;
194
}
195
196
200
public
function
setChange
(?
string
$change
): void
201
{
202
$this->change =
$change
;
203
}
204
208
public
function
setPreviousValue
(
$previousValue
): void
209
{
210
$this->previousValue =
$previousValue
;
211
}
212
216
public
function
setNextValue
(
$nextValue
): void
217
{
218
$this->nextValue =
$nextValue
;
219
}
220
224
public
function
setName
(?
string
$name
): void
225
{
226
$this->name =
$name
;
227
}
228
232
public
function
setCustomTypeId
(?
string
$customTypeId
): void
233
{
234
$this->customTypeId =
$customTypeId
;
235
}
236
237
238
239
}
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\SetCustomFieldChangeModel
Definition
SetCustomFieldChangeModel.php:21
Commercetools\History\Models\Change\SetCustomFieldChangeModel\__construct
__construct(?string $change=null, $previousValue=null, $nextValue=null, ?string $name=null, ?string $customTypeId=null, ?string $type=null)
Definition
SetCustomFieldChangeModel.php:64
Commercetools\History\Models\Change\SetCustomFieldChangeModel\getChange
getChange()
Definition
SetCustomFieldChangeModel.php:102
Commercetools\History\Models\Change\SetCustomFieldChangeModel\setPreviousValue
setPreviousValue( $previousValue)
Definition
SetCustomFieldChangeModel.php:208
Commercetools\History\Models\Change\SetCustomFieldChangeModel\$previousValue
$previousValue
Definition
SetCustomFieldChangeModel.php:40
Commercetools\History\Models\Change\SetCustomFieldChangeModel\getNextValue
getNextValue()
Definition
SetCustomFieldChangeModel.php:142
Commercetools\History\Models\Change\SetCustomFieldChangeModel\$change
$change
Definition
SetCustomFieldChangeModel.php:34
Commercetools\History\Models\Change\SetCustomFieldChangeModel\setNextValue
setNextValue( $nextValue)
Definition
SetCustomFieldChangeModel.php:216
Commercetools\History\Models\Change\SetCustomFieldChangeModel\$nextValue
$nextValue
Definition
SetCustomFieldChangeModel.php:46
Commercetools\History\Models\Change\SetCustomFieldChangeModel\setChange
setChange(?string $change)
Definition
SetCustomFieldChangeModel.php:200
Commercetools\History\Models\Change\SetCustomFieldChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
SetCustomFieldChangeModel.php:23
Commercetools\History\Models\Change\SetCustomFieldChangeModel\getType
getType()
Definition
SetCustomFieldChangeModel.php:84
Commercetools\History\Models\Change\SetCustomFieldChangeModel\getName
getName()
Definition
SetCustomFieldChangeModel.php:162
Commercetools\History\Models\Change\SetCustomFieldChangeModel\$type
$type
Definition
SetCustomFieldChangeModel.php:28
Commercetools\History\Models\Change\SetCustomFieldChangeModel\setCustomTypeId
setCustomTypeId(?string $customTypeId)
Definition
SetCustomFieldChangeModel.php:232
Commercetools\History\Models\Change\SetCustomFieldChangeModel\$name
$name
Definition
SetCustomFieldChangeModel.php:52
Commercetools\History\Models\Change\SetCustomFieldChangeModel\getPreviousValue
getPreviousValue()
Definition
SetCustomFieldChangeModel.php:122
Commercetools\History\Models\Change\SetCustomFieldChangeModel\$customTypeId
$customTypeId
Definition
SetCustomFieldChangeModel.php:58
Commercetools\History\Models\Change\SetCustomFieldChangeModel\getCustomTypeId
getCustomTypeId()
Definition
SetCustomFieldChangeModel.php:182
Commercetools\History\Models\Change\SetCustomFieldChangeModel\setName
setName(?string $name)
Definition
SetCustomFieldChangeModel.php:224
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\SetCustomFieldChange
Definition
SetCustomFieldChange.php:15
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8