commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Message
QuoteCreatedMessagePayloadModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Message
;
10
11
use
Commercetools\Api\Models\Quote\Quote
;
12
use
Commercetools\Api\Models\Quote\QuoteModel
;
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
QuoteCreatedMessagePayloadModel
extends
JsonObjectModel
implements
QuoteCreatedMessagePayload
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'QuoteCreated'
;
29
protected
$type
;
30
35
protected
$quote
;
36
37
41
public
function
__construct
(
42
?
Quote
$quote
=
null
,
43
?
string
$type
=
null
44
) {
45
$this->quote =
$quote
;
46
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
47
}
48
53
public
function
getType
()
54
{
55
if
(is_null($this->type)) {
57
$data = $this->
raw
(self::FIELD_TYPE);
58
if
(is_null($data)) {
59
return
null
;
60
}
61
$this->type = (string) $data;
62
}
63
64
return
$this->type
;
65
}
66
73
public
function
getQuote
()
74
{
75
if
(is_null($this->quote)) {
77
$data = $this->
raw
(self::FIELD_QUOTE);
78
if
(is_null($data)) {
79
return
null
;
80
}
81
82
$this->quote =
QuoteModel::of
($data);
83
}
84
85
return
$this->quote
;
86
}
87
88
92
public
function
setQuote
(?
Quote
$quote
): void
93
{
94
$this->quote =
$quote
;
95
}
96
}
Commercetools\Api\Models\Message\QuoteCreatedMessagePayloadModel
Definition:
QuoteCreatedMessagePayloadModel.php:23
Commercetools\Api\Models\Message\QuoteCreatedMessagePayloadModel\$quote
$quote
Definition:
QuoteCreatedMessagePayloadModel.php:35
Commercetools\Api\Models\Message\QuoteCreatedMessagePayloadModel\setQuote
setQuote(?Quote $quote)
Definition:
QuoteCreatedMessagePayloadModel.php:92
Commercetools\Api\Models\Message\QuoteCreatedMessagePayloadModel\getQuote
getQuote()
Definition:
QuoteCreatedMessagePayloadModel.php:73
Commercetools\Api\Models\Message\QuoteCreatedMessagePayloadModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
QuoteCreatedMessagePayloadModel.php:24
Commercetools\Api\Models\Message\QuoteCreatedMessagePayloadModel\getType
getType()
Definition:
QuoteCreatedMessagePayloadModel.php:53
Commercetools\Api\Models\Message\QuoteCreatedMessagePayloadModel\__construct
__construct(?Quote $quote=null, ?string $type=null)
Definition:
QuoteCreatedMessagePayloadModel.php:41
Commercetools\Api\Models\Message\QuoteCreatedMessagePayloadModel\$type
$type
Definition:
QuoteCreatedMessagePayloadModel.php:29
Commercetools\Api\Models\Quote\QuoteModel
Definition:
QuoteModel.php:60
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\QuoteCreatedMessagePayload
Definition:
QuoteCreatedMessagePayload.php:16
Commercetools\Api\Models\Quote\Quote
Definition:
Quote.php:37
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Message
Definition:
ApprovalFlowApprovedMessage.php:9
Generated by
1.9.1