commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Message
QuoteCustomerChangedMessagePayloadModel.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\Base\DateTimeImmutableCollection
;
14
use
Commercetools\Base\JsonObject
;
15
use
Commercetools\Base\JsonObjectModel
;
16
use
Commercetools\Base\MapperFactory
;
17
use stdClass;
18
22
final
class
QuoteCustomerChangedMessagePayloadModel
extends
JsonObjectModel
implements
QuoteCustomerChangedMessagePayload
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'QuoteCustomerChanged'
;
29
protected
$type
;
30
35
protected
$customer
;
36
41
protected
$previousCustomer
;
42
43
47
public
function
__construct
(
48
?
CustomerReference
$customer
=
null
,
49
?
CustomerReference
$previousCustomer
=
null
,
50
?
string
$type
=
null
51
) {
52
$this->customer =
$customer
;
53
$this->previousCustomer =
$previousCustomer
;
54
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
55
}
56
61
public
function
getType
()
62
{
63
if
(is_null($this->type)) {
65
$data = $this->
raw
(self::FIELD_TYPE);
66
if
(is_null($data)) {
67
return
null
;
68
}
69
$this->type = (string) $data;
70
}
71
72
return
$this->type
;
73
}
74
81
public
function
getCustomer
()
82
{
83
if
(is_null($this->customer)) {
85
$data = $this->
raw
(self::FIELD_CUSTOMER);
86
if
(is_null($data)) {
87
return
null
;
88
}
89
90
$this->customer =
CustomerReferenceModel::of
($data);
91
}
92
93
return
$this->customer
;
94
}
95
102
public
function
getPreviousCustomer
()
103
{
104
if
(is_null($this->previousCustomer)) {
106
$data = $this->
raw
(self::FIELD_PREVIOUS_CUSTOMER);
107
if
(is_null($data)) {
108
return
null
;
109
}
110
111
$this->previousCustomer =
CustomerReferenceModel::of
($data);
112
}
113
114
return
$this->previousCustomer
;
115
}
116
117
121
public
function
setCustomer
(?
CustomerReference
$customer
): void
122
{
123
$this->customer =
$customer
;
124
}
125
129
public
function
setPreviousCustomer
(?
CustomerReference
$previousCustomer
): void
130
{
131
$this->previousCustomer =
$previousCustomer
;
132
}
133
}
Commercetools\Api\Models\Customer\CustomerReferenceModel
Definition:
CustomerReferenceModel.php:23
Commercetools\Api\Models\Message\QuoteCustomerChangedMessagePayloadModel
Definition:
QuoteCustomerChangedMessagePayloadModel.php:23
Commercetools\Api\Models\Message\QuoteCustomerChangedMessagePayloadModel\$customer
$customer
Definition:
QuoteCustomerChangedMessagePayloadModel.php:35
Commercetools\Api\Models\Message\QuoteCustomerChangedMessagePayloadModel\setPreviousCustomer
setPreviousCustomer(?CustomerReference $previousCustomer)
Definition:
QuoteCustomerChangedMessagePayloadModel.php:129
Commercetools\Api\Models\Message\QuoteCustomerChangedMessagePayloadModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
QuoteCustomerChangedMessagePayloadModel.php:24
Commercetools\Api\Models\Message\QuoteCustomerChangedMessagePayloadModel\setCustomer
setCustomer(?CustomerReference $customer)
Definition:
QuoteCustomerChangedMessagePayloadModel.php:121
Commercetools\Api\Models\Message\QuoteCustomerChangedMessagePayloadModel\getPreviousCustomer
getPreviousCustomer()
Definition:
QuoteCustomerChangedMessagePayloadModel.php:102
Commercetools\Api\Models\Message\QuoteCustomerChangedMessagePayloadModel\getType
getType()
Definition:
QuoteCustomerChangedMessagePayloadModel.php:61
Commercetools\Api\Models\Message\QuoteCustomerChangedMessagePayloadModel\$type
$type
Definition:
QuoteCustomerChangedMessagePayloadModel.php:29
Commercetools\Api\Models\Message\QuoteCustomerChangedMessagePayloadModel\__construct
__construct(?CustomerReference $customer=null, ?CustomerReference $previousCustomer=null, ?string $type=null)
Definition:
QuoteCustomerChangedMessagePayloadModel.php:47
Commercetools\Api\Models\Message\QuoteCustomerChangedMessagePayloadModel\getCustomer
getCustomer()
Definition:
QuoteCustomerChangedMessagePayloadModel.php:81
Commercetools\Api\Models\Message\QuoteCustomerChangedMessagePayloadModel\$previousCustomer
$previousCustomer
Definition:
QuoteCustomerChangedMessagePayloadModel.php:41
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\QuoteCustomerChangedMessagePayload
Definition:
QuoteCustomerChangedMessagePayload.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Message
Definition:
ApprovalFlowApprovedMessage.php:9
Generated by
1.9.1