commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
State
StateReferenceModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\State
;
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
StateReferenceModel
extends
JsonObjectModel
implements
StateReference
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'state'
;
29
protected
$typeId
;
30
35
protected
$id
;
36
41
protected
$obj
;
42
43
47
public
function
__construct
(
48
?
string
$id
=
null
,
49
?
State
$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 =
StateModel::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
(?
State
$obj
): void
131
{
132
$this->obj =
$obj
;
133
}
134
}
Commercetools\Api\Models\Common\ReferenceModel
Definition:
ReferenceModel.php:91
Commercetools\Api\Models\State\StateReferenceModel
Definition:
StateReferenceModel.php:23
Commercetools\Api\Models\State\StateReferenceModel\$id
$id
Definition:
StateReferenceModel.php:35
Commercetools\Api\Models\State\StateReferenceModel\__construct
__construct(?string $id=null, ?State $obj=null, ?string $typeId=null)
Definition:
StateReferenceModel.php:47
Commercetools\Api\Models\State\StateReferenceModel\$typeId
$typeId
Definition:
StateReferenceModel.php:29
Commercetools\Api\Models\State\StateReferenceModel\setId
setId(?string $id)
Definition:
StateReferenceModel.php:122
Commercetools\Api\Models\State\StateReferenceModel\setObj
setObj(?State $obj)
Definition:
StateReferenceModel.php:130
Commercetools\Api\Models\State\StateReferenceModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
StateReferenceModel.php:24
Commercetools\Api\Models\State\StateReferenceModel\getObj
getObj()
Definition:
StateReferenceModel.php:103
Commercetools\Api\Models\State\StateReferenceModel\getTypeId
getTypeId()
Definition:
StateReferenceModel.php:63
Commercetools\Api\Models\State\StateReferenceModel\getId
getId()
Definition:
StateReferenceModel.php:83
Commercetools\Api\Models\State\StateReferenceModel\$obj
$obj
Definition:
StateReferenceModel.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\Common\Reference
Definition:
Reference.php:50
Commercetools\Api\Models\State\State
Definition:
State.php:20
Commercetools\Api\Models\State\StateReference
Definition:
StateReference.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\State
Definition:
State.php:9
Generated by
1.9.1