commercetools-sdk-php-v2
master
The platform, import-api and ml-api PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
Common
LocalizedEnumValueModel.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
LocalizedEnumValueModel
extends
JsonObjectModel
implements
LocalizedEnumValue
21
{
26
protected
$key
;
27
32
protected
$label
;
33
34
38
public
function
__construct
(
39
?
string
$key
=
null
,
40
?
LocalizedString
$label
=
null
41
) {
42
$this->key =
$key
;
43
$this->label =
$label
;
44
}
45
50
public
function
getKey
()
51
{
52
if
(is_null($this->key)) {
54
$data = $this->
raw
(self::FIELD_KEY);
55
if
(is_null($data)) {
56
return
null
;
57
}
58
$this->key = (string) $data;
59
}
60
61
return
$this->key
;
62
}
63
75
public
function
getLabel
()
76
{
77
if
(is_null($this->label)) {
79
$data = $this->
raw
(self::FIELD_LABEL);
80
if
(is_null($data)) {
81
return
null
;
82
}
83
84
$this->label =
LocalizedStringModel::of
($data);
85
}
86
87
return
$this->label
;
88
}
89
90
94
public
function
setKey
(?
string
$key
): void
95
{
96
$this->key =
$key
;
97
}
98
102
public
function
setLabel
(?
LocalizedString
$label
): void
103
{
104
$this->label =
$label
;
105
}
106
}
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\Base\MapperMap\of
static of($data=null)
Definition:
MapperMap.php:45
Commercetools\Import\Models\Common\LocalizedEnumValueModel
Definition:
LocalizedEnumValueModel.php:21
Commercetools\Import\Models\Common\LocalizedEnumValueModel\__construct
__construct(?string $key=null, ?LocalizedString $label=null)
Definition:
LocalizedEnumValueModel.php:38
Commercetools\Import\Models\Common\LocalizedEnumValueModel\setKey
setKey(?string $key)
Definition:
LocalizedEnumValueModel.php:94
Commercetools\Import\Models\Common\LocalizedEnumValueModel\$key
$key
Definition:
LocalizedEnumValueModel.php:26
Commercetools\Import\Models\Common\LocalizedEnumValueModel\$label
$label
Definition:
LocalizedEnumValueModel.php:32
Commercetools\Import\Models\Common\LocalizedEnumValueModel\getLabel
getLabel()
Definition:
LocalizedEnumValueModel.php:75
Commercetools\Import\Models\Common\LocalizedEnumValueModel\getKey
getKey()
Definition:
LocalizedEnumValueModel.php:50
Commercetools\Import\Models\Common\LocalizedEnumValueModel\setLabel
setLabel(?LocalizedString $label)
Definition:
LocalizedEnumValueModel.php:102
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\Common\LocalizedEnumValue
Definition:
LocalizedEnumValue.php:15
Commercetools\Import\Models\Common\LocalizedString
Definition:
LocalizedString.php:14
Commercetools\Import\Models\Common
Definition:
Address.php:9
Generated by
1.9.1