commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Type
CustomFieldsDraftModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Type
;
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
CustomFieldsDraftModel
extends
JsonObjectModel
implements
CustomFieldsDraft
21
{
26
protected
$type
;
27
32
protected
$fields
;
33
34
38
public
function
__construct
(
39
?
TypeResourceIdentifier
$type
=
null
,
40
?
FieldContainer
$fields
=
null
41
) {
42
$this->type =
$type
;
43
$this->fields =
$fields
;
44
}
45
52
public
function
getType
()
53
{
54
if
(is_null($this->type)) {
56
$data = $this->
raw
(self::FIELD_TYPE);
57
if
(is_null($data)) {
58
return
null
;
59
}
60
61
$this->type =
TypeResourceIdentifierModel::of
($data);
62
}
63
64
return
$this->type
;
65
}
66
73
public
function
getFields
()
74
{
75
if
(is_null($this->fields)) {
77
$data = $this->
raw
(self::FIELD_FIELDS);
78
if
(is_null($data)) {
79
return
null
;
80
}
81
82
$this->fields =
FieldContainerModel::of
($data);
83
}
84
85
return
$this->fields
;
86
}
87
88
92
public
function
setType
(?
TypeResourceIdentifier
$type
): void
93
{
94
$this->type =
$type
;
95
}
96
100
public
function
setFields
(?
FieldContainer
$fields
): void
101
{
102
$this->fields =
$fields
;
103
}
104
}
Commercetools\Api\Models\Type\CustomFieldsDraftModel
Definition:
CustomFieldsDraftModel.php:21
Commercetools\Api\Models\Type\CustomFieldsDraftModel\$type
$type
Definition:
CustomFieldsDraftModel.php:26
Commercetools\Api\Models\Type\CustomFieldsDraftModel\setFields
setFields(?FieldContainer $fields)
Definition:
CustomFieldsDraftModel.php:100
Commercetools\Api\Models\Type\CustomFieldsDraftModel\__construct
__construct(?TypeResourceIdentifier $type=null, ?FieldContainer $fields=null)
Definition:
CustomFieldsDraftModel.php:38
Commercetools\Api\Models\Type\CustomFieldsDraftModel\$fields
$fields
Definition:
CustomFieldsDraftModel.php:32
Commercetools\Api\Models\Type\CustomFieldsDraftModel\getType
getType()
Definition:
CustomFieldsDraftModel.php:52
Commercetools\Api\Models\Type\CustomFieldsDraftModel\setType
setType(?TypeResourceIdentifier $type)
Definition:
CustomFieldsDraftModel.php:92
Commercetools\Api\Models\Type\CustomFieldsDraftModel\getFields
getFields()
Definition:
CustomFieldsDraftModel.php:73
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition:
BaseJsonObject.php:57
Commercetools\Base\BaseJsonObject\of
static of($data=null)
Definition:
BaseJsonObject.php:26
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\Api\Models\Type\CustomFieldsDraft
Definition:
CustomFieldsDraft.php:15
Commercetools\Api\Models\Type\FieldContainer
Definition:
FieldContainer.php:14
Commercetools\Api\Models\Type\TypeResourceIdentifier
Definition:
TypeResourceIdentifier.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Type
Definition:
CustomFieldBooleanType.php:9
Generated by
1.9.1