commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-import
src
Models
Errors
InvalidStateTransitionErrorModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Import\Models\Errors
;
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
InvalidStateTransitionErrorModel
extends
JsonObjectModel
implements
InvalidStateTransitionError
21
{
22
public
const
DISCRIMINATOR_VALUE
=
'InvalidTransition'
;
27
protected
$code
;
28
33
protected
$message
;
34
39
protected
$currentState
;
40
45
protected
$newState
;
46
47
51
public
function
__construct
(
52
?
string
$message
=
null
,
53
?
string
$currentState
=
null
,
54
?
string
$newState
=
null
,
55
?
string
$code
=
null
56
) {
57
$this->message =
$message
;
58
$this->currentState =
$currentState
;
59
$this->newState =
$newState
;
60
$this->code =
$code
??
self::DISCRIMINATOR_VALUE
;
61
}
62
69
public
function
getCode
()
70
{
71
if
(is_null($this->code)) {
73
$data = $this->
raw
(self::FIELD_CODE);
74
if
(is_null($data)) {
75
return
null
;
76
}
77
$this->code = (string) $data;
78
}
79
80
return
$this->code
;
81
}
82
89
public
function
getMessage
()
90
{
91
if
(is_null($this->message)) {
93
$data = $this->
raw
(self::FIELD_MESSAGE);
94
if
(is_null($data)) {
95
return
null
;
96
}
97
$this->message = (string) $data;
98
}
99
100
return
$this->message
;
101
}
102
109
public
function
getCurrentState
()
110
{
111
if
(is_null($this->currentState)) {
113
$data = $this->
raw
(self::FIELD_CURRENT_STATE);
114
if
(is_null($data)) {
115
return
null
;
116
}
117
$this->currentState = (string) $data;
118
}
119
120
return
$this->currentState
;
121
}
122
129
public
function
getNewState
()
130
{
131
if
(is_null($this->newState)) {
133
$data = $this->
raw
(self::FIELD_NEW_STATE);
134
if
(is_null($data)) {
135
return
null
;
136
}
137
$this->newState = (string) $data;
138
}
139
140
return
$this->newState
;
141
}
142
143
147
public
function
setMessage
(?
string
$message
): void
148
{
149
$this->message =
$message
;
150
}
151
155
public
function
setCurrentState
(?
string
$currentState
): void
156
{
157
$this->currentState =
$currentState
;
158
}
159
163
public
function
setNewState
(?
string
$newState
): void
164
{
165
$this->newState =
$newState
;
166
}
167
}
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\Import\Models\Errors\InvalidStateTransitionErrorModel
Definition
InvalidStateTransitionErrorModel.php:21
Commercetools\Import\Models\Errors\InvalidStateTransitionErrorModel\getCurrentState
getCurrentState()
Definition
InvalidStateTransitionErrorModel.php:109
Commercetools\Import\Models\Errors\InvalidStateTransitionErrorModel\getCode
getCode()
Definition
InvalidStateTransitionErrorModel.php:69
Commercetools\Import\Models\Errors\InvalidStateTransitionErrorModel\$currentState
$currentState
Definition
InvalidStateTransitionErrorModel.php:39
Commercetools\Import\Models\Errors\InvalidStateTransitionErrorModel\$code
$code
Definition
InvalidStateTransitionErrorModel.php:27
Commercetools\Import\Models\Errors\InvalidStateTransitionErrorModel\$message
$message
Definition
InvalidStateTransitionErrorModel.php:33
Commercetools\Import\Models\Errors\InvalidStateTransitionErrorModel\getNewState
getNewState()
Definition
InvalidStateTransitionErrorModel.php:129
Commercetools\Import\Models\Errors\InvalidStateTransitionErrorModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
InvalidStateTransitionErrorModel.php:22
Commercetools\Import\Models\Errors\InvalidStateTransitionErrorModel\setMessage
setMessage(?string $message)
Definition
InvalidStateTransitionErrorModel.php:147
Commercetools\Import\Models\Errors\InvalidStateTransitionErrorModel\setCurrentState
setCurrentState(?string $currentState)
Definition
InvalidStateTransitionErrorModel.php:155
Commercetools\Import\Models\Errors\InvalidStateTransitionErrorModel\getMessage
getMessage()
Definition
InvalidStateTransitionErrorModel.php:89
Commercetools\Import\Models\Errors\InvalidStateTransitionErrorModel\__construct
__construct(?string $message=null, ?string $currentState=null, ?string $newState=null, ?string $code=null)
Definition
InvalidStateTransitionErrorModel.php:51
Commercetools\Import\Models\Errors\InvalidStateTransitionErrorModel\setNewState
setNewState(?string $newState)
Definition
InvalidStateTransitionErrorModel.php:163
Commercetools\Import\Models\Errors\InvalidStateTransitionErrorModel\$newState
$newState
Definition
InvalidStateTransitionErrorModel.php:45
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Import\Models\Errors\InvalidStateTransitionError
Definition
InvalidStateTransitionError.php:15
Commercetools\Import\Models\Errors
Definition
AccessDeniedError.php:9
Generated by
1.9.8