commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
Productvariants
LocalizableTextAttributeModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Import\Models\Productvariants
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use
Commercetools\Import\Models\Common\LocalizedString
;
16
use
Commercetools\Import\Models\Common\LocalizedStringModel
;
17
use stdClass;
18
22
final
class
LocalizableTextAttributeModel
extends
JsonObjectModel
implements
LocalizableTextAttribute
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'ltext'
;
29
protected
$name
;
30
35
protected
$type
;
36
41
protected
$value
;
42
43
47
public
function
__construct
(
48
?
string
$name
=
null
,
49
?
LocalizedString
$value
=
null
,
50
?
string
$type
=
null
51
) {
52
$this->name =
$name
;
53
$this->value =
$value
;
54
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
55
}
56
65
public
function
getName
()
66
{
67
if
(is_null($this->name)) {
69
$data = $this->
raw
(self::FIELD_NAME);
70
if
(is_null($data)) {
71
return
null
;
72
}
73
$this->name = (string) $data;
74
}
75
76
return
$this->name
;
77
}
78
83
public
function
getType
()
84
{
85
if
(is_null($this->type)) {
87
$data = $this->
raw
(self::FIELD_TYPE);
88
if
(is_null($data)) {
89
return
null
;
90
}
91
$this->type = (string) $data;
92
}
93
94
return
$this->type
;
95
}
96
108
public
function
getValue
()
109
{
110
if
(is_null($this->value)) {
112
$data = $this->
raw
(self::FIELD_VALUE);
113
if
(is_null($data)) {
114
return
null
;
115
}
116
117
$this->value =
LocalizedStringModel::of
($data);
118
}
119
120
return
$this->value
;
121
}
122
123
127
public
function
setName
(?
string
$name
): void
128
{
129
$this->name =
$name
;
130
}
131
135
public
function
setValue
(?
LocalizedString
$value
): void
136
{
137
$this->value =
$value
;
138
}
139
}
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\LocalizedStringModel
Definition:
LocalizedStringModel.php:17
Commercetools\Import\Models\Productvariants\LocalizableTextAttributeModel
Definition:
LocalizableTextAttributeModel.php:23
Commercetools\Import\Models\Productvariants\LocalizableTextAttributeModel\__construct
__construct(?string $name=null, ?LocalizedString $value=null, ?string $type=null)
Definition:
LocalizableTextAttributeModel.php:47
Commercetools\Import\Models\Productvariants\LocalizableTextAttributeModel\$value
$value
Definition:
LocalizableTextAttributeModel.php:41
Commercetools\Import\Models\Productvariants\LocalizableTextAttributeModel\$type
$type
Definition:
LocalizableTextAttributeModel.php:35
Commercetools\Import\Models\Productvariants\LocalizableTextAttributeModel\$name
$name
Definition:
LocalizableTextAttributeModel.php:29
Commercetools\Import\Models\Productvariants\LocalizableTextAttributeModel\setName
setName(?string $name)
Definition:
LocalizableTextAttributeModel.php:127
Commercetools\Import\Models\Productvariants\LocalizableTextAttributeModel\getValue
getValue()
Definition:
LocalizableTextAttributeModel.php:108
Commercetools\Import\Models\Productvariants\LocalizableTextAttributeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
LocalizableTextAttributeModel.php:24
Commercetools\Import\Models\Productvariants\LocalizableTextAttributeModel\setValue
setValue(?LocalizedString $value)
Definition:
LocalizableTextAttributeModel.php:135
Commercetools\Import\Models\Productvariants\LocalizableTextAttributeModel\getType
getType()
Definition:
LocalizableTextAttributeModel.php:83
Commercetools\Import\Models\Productvariants\LocalizableTextAttributeModel\getName
getName()
Definition:
LocalizableTextAttributeModel.php:65
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\Common\LocalizedString
Definition:
LocalizedString.php:14
Commercetools\Import\Models\Productvariants\LocalizableTextAttribute
Definition:
LocalizableTextAttribute.php:16
Commercetools\Import\Models\Productvariants
Definition:
Attribute.php:9
Generated by
1.9.1