commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
AssociateRole
AssociateRoleKeyReferenceModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\AssociateRole
;
10
11
use
Commercetools\Api\Models\Common\KeyReference
;
12
use
Commercetools\Api\Models\Common\KeyReferenceModel
;
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
AssociateRoleKeyReferenceModel
extends
JsonObjectModel
implements
AssociateRoleKeyReference
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'associate-role'
;
29
protected
$typeId
;
30
35
protected
$key
;
36
37
41
public
function
__construct
(
42
?
string
$key
=
null
,
43
?
string
$typeId
=
null
44
) {
45
$this->key =
$key
;
46
$this->typeId =
$typeId
??
self::DISCRIMINATOR_VALUE
;
47
}
48
55
public
function
getTypeId
()
56
{
57
if
(is_null($this->typeId)) {
59
$data = $this->
raw
(self::FIELD_TYPE_ID);
60
if
(is_null($data)) {
61
return
null
;
62
}
63
$this->typeId = (string) $data;
64
}
65
66
return
$this->typeId
;
67
}
68
75
public
function
getKey
()
76
{
77
if
(is_null($this->key)) {
79
$data = $this->
raw
(self::FIELD_KEY);
80
if
(is_null($data)) {
81
return
null
;
82
}
83
$this->key = (string) $data;
84
}
85
86
return
$this->key
;
87
}
88
89
93
public
function
setKey
(?
string
$key
): void
94
{
95
$this->key =
$key
;
96
}
97
}
Commercetools\Api\Models\AssociateRole\AssociateRoleKeyReferenceModel
Definition:
AssociateRoleKeyReferenceModel.php:23
Commercetools\Api\Models\AssociateRole\AssociateRoleKeyReferenceModel\$typeId
$typeId
Definition:
AssociateRoleKeyReferenceModel.php:29
Commercetools\Api\Models\AssociateRole\AssociateRoleKeyReferenceModel\$key
$key
Definition:
AssociateRoleKeyReferenceModel.php:35
Commercetools\Api\Models\AssociateRole\AssociateRoleKeyReferenceModel\setKey
setKey(?string $key)
Definition:
AssociateRoleKeyReferenceModel.php:93
Commercetools\Api\Models\AssociateRole\AssociateRoleKeyReferenceModel\__construct
__construct(?string $key=null, ?string $typeId=null)
Definition:
AssociateRoleKeyReferenceModel.php:41
Commercetools\Api\Models\AssociateRole\AssociateRoleKeyReferenceModel\getTypeId
getTypeId()
Definition:
AssociateRoleKeyReferenceModel.php:55
Commercetools\Api\Models\AssociateRole\AssociateRoleKeyReferenceModel\getKey
getKey()
Definition:
AssociateRoleKeyReferenceModel.php:75
Commercetools\Api\Models\AssociateRole\AssociateRoleKeyReferenceModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
AssociateRoleKeyReferenceModel.php:24
Commercetools\Api\Models\Common\KeyReferenceModel
Definition:
KeyReferenceModel.php:27
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\AssociateRole\AssociateRoleKeyReference
Definition:
AssociateRoleKeyReference.php:16
Commercetools\Api\Models\Common\KeyReference
Definition:
KeyReference.php:18
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\AssociateRole
Definition:
AssociateRole.php:9
Generated by
1.9.1