commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Message
QuoteStateTransitionMessagePayloadModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Message
;
10
11
use
Commercetools\Api\Models\State\StateReference
;
12
use
Commercetools\Api\Models\State\StateReferenceModel
;
13
use
Commercetools\Base\DateTimeImmutableCollection
;
14
use
Commercetools\Base\JsonObject
;
15
use
Commercetools\Base\JsonObjectModel
;
16
use
Commercetools\Base\MapperFactory
;
17
use stdClass;
18
22
final
class
QuoteStateTransitionMessagePayloadModel
extends
JsonObjectModel
implements
QuoteStateTransitionMessagePayload
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'QuoteStateTransition'
;
29
protected
$type
;
30
35
protected
$state
;
36
41
protected
$oldState
;
42
47
protected
$force
;
48
49
53
public
function
__construct
(
54
?
StateReference
$state
=
null
,
55
?
StateReference
$oldState
=
null
,
56
?
bool
$force
=
null
,
57
?
string
$type
=
null
58
) {
59
$this->state =
$state
;
60
$this->oldState =
$oldState
;
61
$this->force =
$force
;
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
89
public
function
getState
()
90
{
91
if
(is_null($this->state)) {
93
$data = $this->
raw
(self::FIELD_STATE);
94
if
(is_null($data)) {
95
return
null
;
96
}
97
98
$this->state =
StateReferenceModel::of
($data);
99
}
100
101
return
$this->state
;
102
}
103
110
public
function
getOldState
()
111
{
112
if
(is_null($this->oldState)) {
114
$data = $this->
raw
(self::FIELD_OLD_STATE);
115
if
(is_null($data)) {
116
return
null
;
117
}
118
119
$this->oldState =
StateReferenceModel::of
($data);
120
}
121
122
return
$this->oldState
;
123
}
124
131
public
function
getForce
()
132
{
133
if
(is_null($this->force)) {
135
$data = $this->
raw
(self::FIELD_FORCE);
136
if
(is_null($data)) {
137
return
null
;
138
}
139
$this->force = (bool) $data;
140
}
141
142
return
$this->force
;
143
}
144
145
149
public
function
setState
(?
StateReference
$state
): void
150
{
151
$this->state =
$state
;
152
}
153
157
public
function
setOldState
(?
StateReference
$oldState
): void
158
{
159
$this->oldState =
$oldState
;
160
}
161
165
public
function
setForce
(?
bool
$force
): void
166
{
167
$this->force =
$force
;
168
}
169
}
Commercetools\Api\Models\Message\QuoteStateTransitionMessagePayloadModel
Definition:
QuoteStateTransitionMessagePayloadModel.php:23
Commercetools\Api\Models\Message\QuoteStateTransitionMessagePayloadModel\getType
getType()
Definition:
QuoteStateTransitionMessagePayloadModel.php:69
Commercetools\Api\Models\Message\QuoteStateTransitionMessagePayloadModel\getState
getState()
Definition:
QuoteStateTransitionMessagePayloadModel.php:89
Commercetools\Api\Models\Message\QuoteStateTransitionMessagePayloadModel\setState
setState(?StateReference $state)
Definition:
QuoteStateTransitionMessagePayloadModel.php:149
Commercetools\Api\Models\Message\QuoteStateTransitionMessagePayloadModel\getForce
getForce()
Definition:
QuoteStateTransitionMessagePayloadModel.php:131
Commercetools\Api\Models\Message\QuoteStateTransitionMessagePayloadModel\__construct
__construct(?StateReference $state=null, ?StateReference $oldState=null, ?bool $force=null, ?string $type=null)
Definition:
QuoteStateTransitionMessagePayloadModel.php:53
Commercetools\Api\Models\Message\QuoteStateTransitionMessagePayloadModel\$type
$type
Definition:
QuoteStateTransitionMessagePayloadModel.php:29
Commercetools\Api\Models\Message\QuoteStateTransitionMessagePayloadModel\$state
$state
Definition:
QuoteStateTransitionMessagePayloadModel.php:35
Commercetools\Api\Models\Message\QuoteStateTransitionMessagePayloadModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
QuoteStateTransitionMessagePayloadModel.php:24
Commercetools\Api\Models\Message\QuoteStateTransitionMessagePayloadModel\$force
$force
Definition:
QuoteStateTransitionMessagePayloadModel.php:47
Commercetools\Api\Models\Message\QuoteStateTransitionMessagePayloadModel\setForce
setForce(?bool $force)
Definition:
QuoteStateTransitionMessagePayloadModel.php:165
Commercetools\Api\Models\Message\QuoteStateTransitionMessagePayloadModel\getOldState
getOldState()
Definition:
QuoteStateTransitionMessagePayloadModel.php:110
Commercetools\Api\Models\Message\QuoteStateTransitionMessagePayloadModel\$oldState
$oldState
Definition:
QuoteStateTransitionMessagePayloadModel.php:41
Commercetools\Api\Models\Message\QuoteStateTransitionMessagePayloadModel\setOldState
setOldState(?StateReference $oldState)
Definition:
QuoteStateTransitionMessagePayloadModel.php:157
Commercetools\Api\Models\State\StateReferenceModel
Definition:
StateReferenceModel.php:23
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition:
BaseJsonObject.php:57
Commercetools\Base\BaseJsonObject\of
static of($data=null)
Definition:
BaseJsonObject.php:26
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Api\Models\Message\QuoteStateTransitionMessagePayload
Definition:
QuoteStateTransitionMessagePayload.php:16
Commercetools\Api\Models\State\StateReference
Definition:
StateReference.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Message
Definition:
ApprovalFlowApprovedMessage.php:9
Generated by
1.9.1