commercetools-sdk-php-v2
master
The platform, import-api and ml-api PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
Producttypes
AttributeSetTypeModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Import\Models\Producttypes
;
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
AttributeSetTypeModel
extends
JsonObjectModel
implements
AttributeSetType
21
{
22
public
const
DISCRIMINATOR_VALUE
=
'set'
;
27
protected
$name
;
28
33
protected
$elementType
;
34
35
39
public
function
__construct
(
40
?
AttributeType
$elementType
=
null
,
41
?
string
$name
=
null
42
) {
43
$this->elementType =
$elementType
;
44
$this->name =
$name
??
self::DISCRIMINATOR_VALUE
;
45
}
46
51
public
function
getName
()
52
{
53
if
(is_null($this->name)) {
55
$data = $this->
raw
(self::FIELD_NAME);
56
if
(is_null($data)) {
57
return
null
;
58
}
59
$this->name = (string) $data;
60
}
61
62
return
$this->name
;
63
}
64
69
public
function
getElementType
()
70
{
71
if
(is_null($this->elementType)) {
73
$data = $this->
raw
(self::FIELD_ELEMENT_TYPE);
74
if
(is_null($data)) {
75
return
null
;
76
}
77
$className =
AttributeTypeModel::resolveDiscriminatorClass
($data);
78
$this->elementType = $className::of($data);
79
}
80
81
return
$this->elementType
;
82
}
83
84
88
public
function
setElementType
(?
AttributeType
$elementType
): void
89
{
90
$this->elementType =
$elementType
;
91
}
92
}
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\Import\Models\Producttypes\AttributeSetTypeModel
Definition:
AttributeSetTypeModel.php:21
Commercetools\Import\Models\Producttypes\AttributeSetTypeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
AttributeSetTypeModel.php:22
Commercetools\Import\Models\Producttypes\AttributeSetTypeModel\$elementType
$elementType
Definition:
AttributeSetTypeModel.php:33
Commercetools\Import\Models\Producttypes\AttributeSetTypeModel\__construct
__construct(?AttributeType $elementType=null, ?string $name=null)
Definition:
AttributeSetTypeModel.php:39
Commercetools\Import\Models\Producttypes\AttributeSetTypeModel\getName
getName()
Definition:
AttributeSetTypeModel.php:51
Commercetools\Import\Models\Producttypes\AttributeSetTypeModel\$name
$name
Definition:
AttributeSetTypeModel.php:27
Commercetools\Import\Models\Producttypes\AttributeSetTypeModel\getElementType
getElementType()
Definition:
AttributeSetTypeModel.php:69
Commercetools\Import\Models\Producttypes\AttributeSetTypeModel\setElementType
setElementType(?AttributeType $elementType)
Definition:
AttributeSetTypeModel.php:88
Commercetools\Import\Models\Producttypes\AttributeTypeModel\resolveDiscriminatorClass
static resolveDiscriminatorClass($value)
Definition:
AttributeTypeModel.php:84
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\Producttypes\AttributeSetType
Definition:
AttributeSetType.php:15
Commercetools\Import\Models\Producttypes\AttributeType
Definition:
AttributeType.php:15
Commercetools\Import\Models\Producttypes
Definition:
AttributeBooleanType.php:9
Generated by
1.9.1