commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
OrderEdit
OrderEditPreviewSuccessModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\OrderEdit
;
10
11
use
Commercetools\Api\Models\Message\MessagePayloadCollection
;
12
use
Commercetools\Base\DateTimeImmutableCollection
;
13
use
Commercetools\Base\JsonObject
;
14
use
Commercetools\Base\JsonObjectModel
;
15
use
Commercetools\Base\MapperFactory
;
16
use stdClass;
17
21
final
class
OrderEditPreviewSuccessModel
extends
JsonObjectModel
implements
OrderEditPreviewSuccess
22
{
23
public
const
DISCRIMINATOR_VALUE
=
'PreviewSuccess'
;
28
protected
$type
;
29
34
protected
$preview
;
35
40
protected
$messagePayloads
;
41
42
46
public
function
__construct
(
47
?
StagedOrder
$preview
=
null
,
48
?
MessagePayloadCollection
$messagePayloads
=
null
,
49
?
string
$type
=
null
50
) {
51
$this->preview =
$preview
;
52
$this->messagePayloads =
$messagePayloads
;
53
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
54
}
55
60
public
function
getType
()
61
{
62
if
(is_null($this->type)) {
64
$data = $this->
raw
(self::FIELD_TYPE);
65
if
(is_null($data)) {
66
return
null
;
67
}
68
$this->type = (string) $data;
69
}
70
71
return
$this->type
;
72
}
73
80
public
function
getPreview
()
81
{
82
if
(is_null($this->preview)) {
84
$data = $this->
raw
(self::FIELD_PREVIEW);
85
if
(is_null($data)) {
86
return
null
;
87
}
88
89
$this->preview =
StagedOrderModel::of
($data);
90
}
91
92
return
$this->preview
;
93
}
94
101
public
function
getMessagePayloads
()
102
{
103
if
(is_null($this->messagePayloads)) {
105
$data = $this->
raw
(self::FIELD_MESSAGE_PAYLOADS);
106
if
(is_null($data)) {
107
return
null
;
108
}
109
$this->messagePayloads =
MessagePayloadCollection::fromArray
($data);
110
}
111
112
return
$this->messagePayloads
;
113
}
114
115
119
public
function
setPreview
(?
StagedOrder
$preview
): void
120
{
121
$this->preview =
$preview
;
122
}
123
127
public
function
setMessagePayloads
(?
MessagePayloadCollection
$messagePayloads
): void
128
{
129
$this->messagePayloads =
$messagePayloads
;
130
}
131
}
Commercetools\Api\Models\Message\MessagePayloadCollection
Definition:
MessagePayloadCollection.php:26
Commercetools\Api\Models\OrderEdit\OrderEditPreviewSuccessModel
Definition:
OrderEditPreviewSuccessModel.php:22
Commercetools\Api\Models\OrderEdit\OrderEditPreviewSuccessModel\$type
$type
Definition:
OrderEditPreviewSuccessModel.php:28
Commercetools\Api\Models\OrderEdit\OrderEditPreviewSuccessModel\$preview
$preview
Definition:
OrderEditPreviewSuccessModel.php:34
Commercetools\Api\Models\OrderEdit\OrderEditPreviewSuccessModel\$messagePayloads
$messagePayloads
Definition:
OrderEditPreviewSuccessModel.php:40
Commercetools\Api\Models\OrderEdit\OrderEditPreviewSuccessModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
OrderEditPreviewSuccessModel.php:23
Commercetools\Api\Models\OrderEdit\OrderEditPreviewSuccessModel\setMessagePayloads
setMessagePayloads(?MessagePayloadCollection $messagePayloads)
Definition:
OrderEditPreviewSuccessModel.php:127
Commercetools\Api\Models\OrderEdit\OrderEditPreviewSuccessModel\setPreview
setPreview(?StagedOrder $preview)
Definition:
OrderEditPreviewSuccessModel.php:119
Commercetools\Api\Models\OrderEdit\OrderEditPreviewSuccessModel\getPreview
getPreview()
Definition:
OrderEditPreviewSuccessModel.php:80
Commercetools\Api\Models\OrderEdit\OrderEditPreviewSuccessModel\getMessagePayloads
getMessagePayloads()
Definition:
OrderEditPreviewSuccessModel.php:101
Commercetools\Api\Models\OrderEdit\OrderEditPreviewSuccessModel\getType
getType()
Definition:
OrderEditPreviewSuccessModel.php:60
Commercetools\Api\Models\OrderEdit\OrderEditPreviewSuccessModel\__construct
__construct(?StagedOrder $preview=null, ?MessagePayloadCollection $messagePayloads=null, ?string $type=null)
Definition:
OrderEditPreviewSuccessModel.php:46
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\Base\MapperSequence\fromArray
static fromArray(array $data)
Definition:
MapperSequence.php:56
Commercetools\Api\Models\OrderEdit\OrderEditPreviewSuccess
Definition:
OrderEditPreviewSuccess.php:16
Commercetools\Api\Models\OrderEdit\StagedOrder
Definition:
StagedOrder.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\OrderEdit
Definition:
OrderEdit.php:9
Generated by
1.9.1