commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-history
src
Models
Label
LocalizedLabelModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\History\Models\Label
;
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
use
Commercetools\History\Models\Common\LocalizedString
;
17
use
Commercetools\History\Models\Common\LocalizedStringModel
;
18
22
final
class
LocalizedLabelModel
extends
JsonObjectModel
implements
LocalizedLabel
23
{
24
25
public
const
DISCRIMINATOR_VALUE
=
'LocalizedLabel'
;
30
protected
$type
;
31
36
protected
$value
;
37
38
42
public
function
__construct
(
43
?
LocalizedString
$value
=
null
,
44
?
string
$type
=
null
45
) {
46
$this->value =
$value
;
47
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
48
}
49
54
public
function
getType
()
55
{
56
if
(is_null($this->type)) {
58
$data = $this->
raw
(self::FIELD_TYPE);
59
if
(is_null($data)) {
60
return
null
;
61
}
62
$this->type = (string) $data;
63
}
64
65
return
$this->type
;
66
}
67
74
public
function
getValue
()
75
{
76
if
(is_null($this->value)) {
78
$data = $this->
raw
(self::FIELD_VALUE);
79
if
(is_null($data)) {
80
return
null
;
81
}
82
83
$this->value =
LocalizedStringModel::of
($data);
84
}
85
86
return
$this->value
;
87
}
88
89
93
public
function
setValue
(?
LocalizedString
$value
): void
94
{
95
$this->value =
$value
;
96
}
97
98
99
100
}
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\History\Models\Common\LocalizedStringModel
Definition:
LocalizedStringModel.php:17
Commercetools\History\Models\Label\LocalizedLabelModel
Definition:
LocalizedLabelModel.php:23
Commercetools\History\Models\Label\LocalizedLabelModel\getType
getType()
Definition:
LocalizedLabelModel.php:54
Commercetools\History\Models\Label\LocalizedLabelModel\getValue
getValue()
Definition:
LocalizedLabelModel.php:74
Commercetools\History\Models\Label\LocalizedLabelModel\setValue
setValue(?LocalizedString $value)
Definition:
LocalizedLabelModel.php:93
Commercetools\History\Models\Label\LocalizedLabelModel\__construct
__construct(?LocalizedString $value=null, ?string $type=null)
Definition:
LocalizedLabelModel.php:42
Commercetools\History\Models\Label\LocalizedLabelModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
LocalizedLabelModel.php:25
Commercetools\History\Models\Label\LocalizedLabelModel\$value
$value
Definition:
LocalizedLabelModel.php:36
Commercetools\History\Models\Label\LocalizedLabelModel\$type
$type
Definition:
LocalizedLabelModel.php:30
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\History\Models\Common\LocalizedString
Definition:
LocalizedString.php:14
Commercetools\History\Models\Label\LocalizedLabel
Definition:
LocalizedLabel.php:16
Commercetools\History\Models\Label
Definition:
AssociateRoleLabel.php:9
Generated by
1.9.1