commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
Customfields
LocalizedStringFieldModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Import\Models\Customfields
;
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
LocalizedStringFieldModel
extends
JsonObjectModel
implements
LocalizedStringField
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'LocalizedString'
;
29
protected
$type
;
30
35
protected
$value
;
36
37
41
public
function
__construct
(
42
?
LocalizedString
$value
=
null
,
43
?
string
$type
=
null
44
) {
45
$this->value =
$value
;
46
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
47
}
48
55
public
function
getType
()
56
{
57
if
(is_null($this->type)) {
59
$data = $this->
raw
(self::FIELD_TYPE);
60
if
(is_null($data)) {
61
return
null
;
62
}
63
$this->type = (string) $data;
64
}
65
66
return
$this->type
;
67
}
68
80
public
function
getValue
()
81
{
82
if
(is_null($this->value)) {
84
$data = $this->
raw
(self::FIELD_VALUE);
85
if
(is_null($data)) {
86
return
null
;
87
}
88
89
$this->value =
LocalizedStringModel::of
($data);
90
}
91
92
return
$this->value
;
93
}
94
95
99
public
function
setValue
(?
LocalizedString
$value
): void
100
{
101
$this->value =
$value
;
102
}
103
}
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\Customfields\LocalizedStringFieldModel
Definition:
LocalizedStringFieldModel.php:23
Commercetools\Import\Models\Customfields\LocalizedStringFieldModel\setValue
setValue(?LocalizedString $value)
Definition:
LocalizedStringFieldModel.php:99
Commercetools\Import\Models\Customfields\LocalizedStringFieldModel\$type
$type
Definition:
LocalizedStringFieldModel.php:29
Commercetools\Import\Models\Customfields\LocalizedStringFieldModel\__construct
__construct(?LocalizedString $value=null, ?string $type=null)
Definition:
LocalizedStringFieldModel.php:41
Commercetools\Import\Models\Customfields\LocalizedStringFieldModel\getValue
getValue()
Definition:
LocalizedStringFieldModel.php:80
Commercetools\Import\Models\Customfields\LocalizedStringFieldModel\$value
$value
Definition:
LocalizedStringFieldModel.php:35
Commercetools\Import\Models\Customfields\LocalizedStringFieldModel\getType
getType()
Definition:
LocalizedStringFieldModel.php:55
Commercetools\Import\Models\Customfields\LocalizedStringFieldModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
LocalizedStringFieldModel.php:24
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\Common\LocalizedString
Definition:
LocalizedString.php:14
Commercetools\Import\Models\Customfields\LocalizedStringField
Definition:
LocalizedStringField.php:16
Commercetools\Import\Models\Customfields
Definition:
BooleanField.php:9
Generated by
1.9.1