commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-history
src
Models
Label
ProductLabelModel.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
ProductLabelModel
extends
JsonObjectModel
implements
ProductLabel
23
{
24
25
public
const
DISCRIMINATOR_VALUE
=
'ProductLabel'
;
30
protected
$type
;
31
36
protected
$slug
;
37
42
protected
$name
;
43
44
48
public
function
__construct
(
49
?
LocalizedString
$slug
=
null
,
50
?
LocalizedString
$name
=
null
,
51
?
string
$type
=
null
52
) {
53
$this->slug =
$slug
;
54
$this->name =
$name
;
55
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
56
}
57
62
public
function
getType
()
63
{
64
if
(is_null($this->type)) {
66
$data = $this->
raw
(self::FIELD_TYPE);
67
if
(is_null($data)) {
68
return
null
;
69
}
70
$this->type = (string) $data;
71
}
72
73
return
$this->type
;
74
}
75
82
public
function
getSlug
()
83
{
84
if
(is_null($this->slug)) {
86
$data = $this->
raw
(self::FIELD_SLUG);
87
if
(is_null($data)) {
88
return
null
;
89
}
90
91
$this->slug =
LocalizedStringModel::of
($data);
92
}
93
94
return
$this->slug
;
95
}
96
103
public
function
getName
()
104
{
105
if
(is_null($this->name)) {
107
$data = $this->
raw
(self::FIELD_NAME);
108
if
(is_null($data)) {
109
return
null
;
110
}
111
112
$this->name =
LocalizedStringModel::of
($data);
113
}
114
115
return
$this->name
;
116
}
117
118
122
public
function
setSlug
(?
LocalizedString
$slug
): void
123
{
124
$this->slug =
$slug
;
125
}
126
130
public
function
setName
(?
LocalizedString
$name
): void
131
{
132
$this->name =
$name
;
133
}
134
135
136
137
}
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\ProductLabelModel
Definition:
ProductLabelModel.php:23
Commercetools\History\Models\Label\ProductLabelModel\$type
$type
Definition:
ProductLabelModel.php:30
Commercetools\History\Models\Label\ProductLabelModel\getName
getName()
Definition:
ProductLabelModel.php:103
Commercetools\History\Models\Label\ProductLabelModel\setSlug
setSlug(?LocalizedString $slug)
Definition:
ProductLabelModel.php:122
Commercetools\History\Models\Label\ProductLabelModel\__construct
__construct(?LocalizedString $slug=null, ?LocalizedString $name=null, ?string $type=null)
Definition:
ProductLabelModel.php:48
Commercetools\History\Models\Label\ProductLabelModel\getType
getType()
Definition:
ProductLabelModel.php:62
Commercetools\History\Models\Label\ProductLabelModel\setName
setName(?LocalizedString $name)
Definition:
ProductLabelModel.php:130
Commercetools\History\Models\Label\ProductLabelModel\$slug
$slug
Definition:
ProductLabelModel.php:36
Commercetools\History\Models\Label\ProductLabelModel\getSlug
getSlug()
Definition:
ProductLabelModel.php:82
Commercetools\History\Models\Label\ProductLabelModel\$name
$name
Definition:
ProductLabelModel.php:42
Commercetools\History\Models\Label\ProductLabelModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
ProductLabelModel.php:25
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\History\Models\Common\LocalizedString
Definition:
LocalizedString.php:14
Commercetools\History\Models\Label\ProductLabel
Definition:
ProductLabel.php:16
Commercetools\History\Models\Label
Definition:
AssociateRoleLabel.php:9
Generated by
1.9.1