commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Customer
CustomerReferenceModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Customer
;
10
11
use
Commercetools\Api\Models\Common\Reference
;
12
use
Commercetools\Api\Models\Common\ReferenceModel
;
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
CustomerReferenceModel
extends
JsonObjectModel
implements
CustomerReference
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'customer'
;
29
protected
$typeId
;
30
35
protected
$id
;
36
41
protected
$obj
;
42
43
47
public
function
__construct
(
48
?
string
$id
=
null
,
49
?
Customer
$obj
=
null
,
50
?
string
$typeId
=
null
51
) {
52
$this->
id
=
$id
;
53
$this->obj =
$obj
;
54
$this->typeId =
$typeId
??
self::DISCRIMINATOR_VALUE
;
55
}
56
63
public
function
getTypeId
()
64
{
65
if
(is_null($this->typeId)) {
67
$data = $this->
raw
(self::FIELD_TYPE_ID);
68
if
(is_null($data)) {
69
return
null
;
70
}
71
$this->typeId = (string) $data;
72
}
73
74
return
$this->typeId
;
75
}
76
83
public
function
getId
()
84
{
85
if
(is_null($this->
id
)) {
87
$data = $this->
raw
(self::FIELD_ID);
88
if
(is_null($data)) {
89
return
null
;
90
}
91
$this->
id
= (string) $data;
92
}
93
94
return
$this->id
;
95
}
96
103
public
function
getObj
()
104
{
105
if
(is_null($this->obj)) {
107
$data = $this->
raw
(self::FIELD_OBJ);
108
if
(is_null($data)) {
109
return
null
;
110
}
111
112
$this->obj =
CustomerModel::of
($data);
113
}
114
115
return
$this->obj
;
116
}
117
118
122
public
function
setId
(?
string
$id
): void
123
{
124
$this->
id
=
$id
;
125
}
126
130
public
function
setObj
(?
Customer
$obj
): void
131
{
132
$this->obj =
$obj
;
133
}
134
}
Commercetools\Api\Models\Common\ReferenceModel
Definition:
ReferenceModel.php:91
Commercetools\Api\Models\Customer\CustomerReferenceModel
Definition:
CustomerReferenceModel.php:23
Commercetools\Api\Models\Customer\CustomerReferenceModel\$obj
$obj
Definition:
CustomerReferenceModel.php:41
Commercetools\Api\Models\Customer\CustomerReferenceModel\getTypeId
getTypeId()
Definition:
CustomerReferenceModel.php:63
Commercetools\Api\Models\Customer\CustomerReferenceModel\setObj
setObj(?Customer $obj)
Definition:
CustomerReferenceModel.php:130
Commercetools\Api\Models\Customer\CustomerReferenceModel\getObj
getObj()
Definition:
CustomerReferenceModel.php:103
Commercetools\Api\Models\Customer\CustomerReferenceModel\$id
$id
Definition:
CustomerReferenceModel.php:35
Commercetools\Api\Models\Customer\CustomerReferenceModel\__construct
__construct(?string $id=null, ?Customer $obj=null, ?string $typeId=null)
Definition:
CustomerReferenceModel.php:47
Commercetools\Api\Models\Customer\CustomerReferenceModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
CustomerReferenceModel.php:24
Commercetools\Api\Models\Customer\CustomerReferenceModel\setId
setId(?string $id)
Definition:
CustomerReferenceModel.php:122
Commercetools\Api\Models\Customer\CustomerReferenceModel\getId
getId()
Definition:
CustomerReferenceModel.php:83
Commercetools\Api\Models\Customer\CustomerReferenceModel\$typeId
$typeId
Definition:
CustomerReferenceModel.php:29
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\Common\Reference
Definition:
Reference.php:50
Commercetools\Api\Models\Customer\Customer
Definition:
Customer.php:23
Commercetools\Api\Models\Customer\CustomerReference
Definition:
CustomerReference.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Customer
Definition:
Customer.php:9
Generated by
1.9.1