commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
Common
CustomObjectKeyReferenceModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Import\Models\Common
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use stdClass;
16
20
final
class
CustomObjectKeyReferenceModel
extends
JsonObjectModel
implements
CustomObjectKeyReference
21
{
22
public
const
DISCRIMINATOR_VALUE
=
'key-value-document'
;
27
protected
$key
;
28
33
protected
$typeId
;
34
39
protected
$container
;
40
41
45
public
function
__construct
(
46
?
string
$key
=
null
,
47
?
string
$container
=
null
,
48
?
string
$typeId
=
null
49
) {
50
$this->key =
$key
;
51
$this->container =
$container
;
52
$this->typeId =
$typeId
??
self::DISCRIMINATOR_VALUE
;
53
}
54
59
public
function
getKey
()
60
{
61
if
(is_null($this->key)) {
63
$data = $this->
raw
(self::FIELD_KEY);
64
if
(is_null($data)) {
65
return
null
;
66
}
67
$this->key = (string) $data;
68
}
69
70
return
$this->key
;
71
}
72
79
public
function
getTypeId
()
80
{
81
if
(is_null($this->typeId)) {
83
$data = $this->
raw
(self::FIELD_TYPE_ID);
84
if
(is_null($data)) {
85
return
null
;
86
}
87
$this->typeId = (string) $data;
88
}
89
90
return
$this->typeId
;
91
}
92
97
public
function
getContainer
()
98
{
99
if
(is_null($this->container)) {
101
$data = $this->
raw
(self::FIELD_CONTAINER);
102
if
(is_null($data)) {
103
return
null
;
104
}
105
$this->container = (string) $data;
106
}
107
108
return
$this->container
;
109
}
110
111
115
public
function
setKey
(?
string
$key
): void
116
{
117
$this->key =
$key
;
118
}
119
123
public
function
setContainer
(?
string
$container
): void
124
{
125
$this->container =
$container
;
126
}
127
}
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\Import\Models\Common\CustomObjectKeyReferenceModel
Definition:
CustomObjectKeyReferenceModel.php:21
Commercetools\Import\Models\Common\CustomObjectKeyReferenceModel\getKey
getKey()
Definition:
CustomObjectKeyReferenceModel.php:59
Commercetools\Import\Models\Common\CustomObjectKeyReferenceModel\setContainer
setContainer(?string $container)
Definition:
CustomObjectKeyReferenceModel.php:123
Commercetools\Import\Models\Common\CustomObjectKeyReferenceModel\$container
$container
Definition:
CustomObjectKeyReferenceModel.php:39
Commercetools\Import\Models\Common\CustomObjectKeyReferenceModel\__construct
__construct(?string $key=null, ?string $container=null, ?string $typeId=null)
Definition:
CustomObjectKeyReferenceModel.php:45
Commercetools\Import\Models\Common\CustomObjectKeyReferenceModel\$key
$key
Definition:
CustomObjectKeyReferenceModel.php:27
Commercetools\Import\Models\Common\CustomObjectKeyReferenceModel\getContainer
getContainer()
Definition:
CustomObjectKeyReferenceModel.php:97
Commercetools\Import\Models\Common\CustomObjectKeyReferenceModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
CustomObjectKeyReferenceModel.php:22
Commercetools\Import\Models\Common\CustomObjectKeyReferenceModel\getTypeId
getTypeId()
Definition:
CustomObjectKeyReferenceModel.php:79
Commercetools\Import\Models\Common\CustomObjectKeyReferenceModel\setKey
setKey(?string $key)
Definition:
CustomObjectKeyReferenceModel.php:115
Commercetools\Import\Models\Common\CustomObjectKeyReferenceModel\$typeId
$typeId
Definition:
CustomObjectKeyReferenceModel.php:33
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\Common\CustomObjectKeyReference
Definition:
CustomObjectKeyReference.php:15
Commercetools\Import\Models\Common
Definition:
Address.php:9
Generated by
1.9.1