commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Message
ApprovalFlowApprovedMessagePayloadModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Message
;
10
11
use
Commercetools\Api\Models\Customer\CustomerReference
;
12
use
Commercetools\Api\Models\Customer\CustomerReferenceModel
;
13
use
Commercetools\Api\Models\Order\OrderReference
;
14
use
Commercetools\Api\Models\Order\OrderReferenceModel
;
15
use
Commercetools\Base\DateTimeImmutableCollection
;
16
use
Commercetools\Base\JsonObject
;
17
use
Commercetools\Base\JsonObjectModel
;
18
use
Commercetools\Base\MapperFactory
;
19
use stdClass;
20
24
final
class
ApprovalFlowApprovedMessagePayloadModel
extends
JsonObjectModel
implements
ApprovalFlowApprovedMessagePayload
25
{
26
public
const
DISCRIMINATOR_VALUE
=
'ApprovalFlowApproved'
;
31
protected
$type
;
32
37
protected
$associate
;
38
43
protected
$order
;
44
45
49
public
function
__construct
(
50
?
CustomerReference
$associate
=
null
,
51
?
OrderReference
$order
=
null
,
52
?
string
$type
=
null
53
) {
54
$this->associate =
$associate
;
55
$this->order =
$order
;
56
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
57
}
58
63
public
function
getType
()
64
{
65
if
(is_null($this->type)) {
67
$data = $this->
raw
(self::FIELD_TYPE);
68
if
(is_null($data)) {
69
return
null
;
70
}
71
$this->type = (string) $data;
72
}
73
74
return
$this->type
;
75
}
76
83
public
function
getAssociate
()
84
{
85
if
(is_null($this->associate)) {
87
$data = $this->
raw
(self::FIELD_ASSOCIATE);
88
if
(is_null($data)) {
89
return
null
;
90
}
91
92
$this->associate =
CustomerReferenceModel::of
($data);
93
}
94
95
return
$this->associate
;
96
}
97
104
public
function
getOrder
()
105
{
106
if
(is_null($this->order)) {
108
$data = $this->
raw
(self::FIELD_ORDER);
109
if
(is_null($data)) {
110
return
null
;
111
}
112
113
$this->order =
OrderReferenceModel::of
($data);
114
}
115
116
return
$this->order
;
117
}
118
119
123
public
function
setAssociate
(?
CustomerReference
$associate
): void
124
{
125
$this->associate =
$associate
;
126
}
127
131
public
function
setOrder
(?
OrderReference
$order
): void
132
{
133
$this->order =
$order
;
134
}
135
}
Commercetools\Api\Models\Customer\CustomerReferenceModel
Definition:
CustomerReferenceModel.php:23
Commercetools\Api\Models\Message\ApprovalFlowApprovedMessagePayloadModel
Definition:
ApprovalFlowApprovedMessagePayloadModel.php:25
Commercetools\Api\Models\Message\ApprovalFlowApprovedMessagePayloadModel\getType
getType()
Definition:
ApprovalFlowApprovedMessagePayloadModel.php:63
Commercetools\Api\Models\Message\ApprovalFlowApprovedMessagePayloadModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
ApprovalFlowApprovedMessagePayloadModel.php:26
Commercetools\Api\Models\Message\ApprovalFlowApprovedMessagePayloadModel\getAssociate
getAssociate()
Definition:
ApprovalFlowApprovedMessagePayloadModel.php:83
Commercetools\Api\Models\Message\ApprovalFlowApprovedMessagePayloadModel\$order
$order
Definition:
ApprovalFlowApprovedMessagePayloadModel.php:43
Commercetools\Api\Models\Message\ApprovalFlowApprovedMessagePayloadModel\$type
$type
Definition:
ApprovalFlowApprovedMessagePayloadModel.php:31
Commercetools\Api\Models\Message\ApprovalFlowApprovedMessagePayloadModel\setOrder
setOrder(?OrderReference $order)
Definition:
ApprovalFlowApprovedMessagePayloadModel.php:131
Commercetools\Api\Models\Message\ApprovalFlowApprovedMessagePayloadModel\getOrder
getOrder()
Definition:
ApprovalFlowApprovedMessagePayloadModel.php:104
Commercetools\Api\Models\Message\ApprovalFlowApprovedMessagePayloadModel\$associate
$associate
Definition:
ApprovalFlowApprovedMessagePayloadModel.php:37
Commercetools\Api\Models\Message\ApprovalFlowApprovedMessagePayloadModel\__construct
__construct(?CustomerReference $associate=null, ?OrderReference $order=null, ?string $type=null)
Definition:
ApprovalFlowApprovedMessagePayloadModel.php:49
Commercetools\Api\Models\Message\ApprovalFlowApprovedMessagePayloadModel\setAssociate
setAssociate(?CustomerReference $associate)
Definition:
ApprovalFlowApprovedMessagePayloadModel.php:123
Commercetools\Api\Models\Order\OrderReferenceModel
Definition:
OrderReferenceModel.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\Customer\CustomerReference
Definition:
CustomerReference.php:16
Commercetools\Api\Models\Message\ApprovalFlowApprovedMessagePayload
Definition:
ApprovalFlowApprovedMessagePayload.php:17
Commercetools\Api\Models\Order\OrderReference
Definition:
OrderReference.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Message
Definition:
ApprovalFlowApprovedMessage.php:9
Generated by
1.9.1