commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
Customfields
CustomModel.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\TypeKeyReference
;
16
use
Commercetools\Import\Models\Common\TypeKeyReferenceModel
;
17
use stdClass;
18
22
final
class
CustomModel
extends
JsonObjectModel
implements
Custom
23
{
28
protected
$type
;
29
34
protected
$fields
;
35
36
40
public
function
__construct
(
41
?
TypeKeyReference
$type
=
null
,
42
?
FieldContainer
$fields
=
null
43
) {
44
$this->type =
$type
;
45
$this->fields =
$fields
;
46
}
47
54
public
function
getType
()
55
{
56
if
(is_null($this->type)) {
58
$data = $this->
raw
(self::FIELD_TYPE);
59
if
(is_null($data)) {
60
return
null
;
61
}
62
63
$this->type =
TypeKeyReferenceModel::of
($data);
64
}
65
66
return
$this->type
;
67
}
68
75
public
function
getFields
()
76
{
77
if
(is_null($this->fields)) {
79
$data = $this->
raw
(self::FIELD_FIELDS);
80
if
(is_null($data)) {
81
return
null
;
82
}
83
84
$this->fields =
FieldContainerModel::of
($data);
85
}
86
87
return
$this->fields
;
88
}
89
90
94
public
function
setType
(?
TypeKeyReference
$type
): void
95
{
96
$this->type =
$type
;
97
}
98
102
public
function
setFields
(?
FieldContainer
$fields
): void
103
{
104
$this->fields =
$fields
;
105
}
106
}
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\Import\Models\Common\TypeKeyReferenceModel
Definition:
TypeKeyReferenceModel.php:21
Commercetools\Import\Models\Customfields\CustomModel
Definition:
CustomModel.php:23
Commercetools\Import\Models\Customfields\CustomModel\setType
setType(?TypeKeyReference $type)
Definition:
CustomModel.php:94
Commercetools\Import\Models\Customfields\CustomModel\$fields
$fields
Definition:
CustomModel.php:34
Commercetools\Import\Models\Customfields\CustomModel\getFields
getFields()
Definition:
CustomModel.php:75
Commercetools\Import\Models\Customfields\CustomModel\setFields
setFields(?FieldContainer $fields)
Definition:
CustomModel.php:102
Commercetools\Import\Models\Customfields\CustomModel\__construct
__construct(?TypeKeyReference $type=null, ?FieldContainer $fields=null)
Definition:
CustomModel.php:40
Commercetools\Import\Models\Customfields\CustomModel\$type
$type
Definition:
CustomModel.php:28
Commercetools\Import\Models\Customfields\CustomModel\getType
getType()
Definition:
CustomModel.php:54
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\Common\TypeKeyReference
Definition:
TypeKeyReference.php:15
Commercetools\Import\Models\Customfields\Custom
Definition:
Custom.php:16
Commercetools\Import\Models\Customfields\FieldContainer
Definition:
FieldContainer.php:14
Commercetools\Import\Models\Customfields
Definition:
BooleanField.php:9
Generated by
1.9.1