commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
State
StateResourceIdentifierModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\State
;
10
11
use
Commercetools\Api\Models\Common\ResourceIdentifier
;
12
use
Commercetools\Api\Models\Common\ResourceIdentifierModel
;
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
StateResourceIdentifierModel
extends
JsonObjectModel
implements
StateResourceIdentifier
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'state'
;
29
protected
$typeId
;
30
35
protected
$id
;
36
41
protected
$key
;
42
43
47
public
function
__construct
(
48
?
string
$id
=
null
,
49
?
string
$key
=
null
,
50
?
string
$typeId
=
null
51
) {
52
$this->
id
=
$id
;
53
$this->key =
$key
;
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
getKey
()
104
{
105
if
(is_null($this->key)) {
107
$data = $this->
raw
(self::FIELD_KEY);
108
if
(is_null($data)) {
109
return
null
;
110
}
111
$this->key = (string) $data;
112
}
113
114
return
$this->key
;
115
}
116
117
121
public
function
setId
(?
string
$id
): void
122
{
123
$this->
id
=
$id
;
124
}
125
129
public
function
setKey
(?
string
$key
): void
130
{
131
$this->key =
$key
;
132
}
133
}
Commercetools\Api\Models\Common\ResourceIdentifierModel
Definition:
ResourceIdentifierModel.php:81
Commercetools\Api\Models\State\StateResourceIdentifierModel
Definition:
StateResourceIdentifierModel.php:23
Commercetools\Api\Models\State\StateResourceIdentifierModel\$id
$id
Definition:
StateResourceIdentifierModel.php:35
Commercetools\Api\Models\State\StateResourceIdentifierModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
StateResourceIdentifierModel.php:24
Commercetools\Api\Models\State\StateResourceIdentifierModel\$typeId
$typeId
Definition:
StateResourceIdentifierModel.php:29
Commercetools\Api\Models\State\StateResourceIdentifierModel\setKey
setKey(?string $key)
Definition:
StateResourceIdentifierModel.php:129
Commercetools\Api\Models\State\StateResourceIdentifierModel\getTypeId
getTypeId()
Definition:
StateResourceIdentifierModel.php:63
Commercetools\Api\Models\State\StateResourceIdentifierModel\setId
setId(?string $id)
Definition:
StateResourceIdentifierModel.php:121
Commercetools\Api\Models\State\StateResourceIdentifierModel\__construct
__construct(?string $id=null, ?string $key=null, ?string $typeId=null)
Definition:
StateResourceIdentifierModel.php:47
Commercetools\Api\Models\State\StateResourceIdentifierModel\getKey
getKey()
Definition:
StateResourceIdentifierModel.php:103
Commercetools\Api\Models\State\StateResourceIdentifierModel\$key
$key
Definition:
StateResourceIdentifierModel.php:41
Commercetools\Api\Models\State\StateResourceIdentifierModel\getId
getId()
Definition:
StateResourceIdentifierModel.php:83
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition:
BaseJsonObject.php:57
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\ResourceIdentifier
Definition:
ResourceIdentifier.php:45
Commercetools\Api\Models\State\StateResourceIdentifier
Definition:
StateResourceIdentifier.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\State
Definition:
State.php:9
Generated by
1.9.1