commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
CustomObject
CustomObjectDraftModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\CustomObject
;
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
CustomObjectDraftModel
extends
JsonObjectModel
implements
CustomObjectDraft
21
{
26
protected
$container
;
27
32
protected
$key
;
33
38
protected
$value
;
39
44
protected
$version
;
45
46
50
public
function
__construct
(
51
?
string
$container
=
null
,
52
?
string
$key
=
null
,
53
$value
=
null
,
54
?
int
$version
=
null
55
) {
56
$this->container =
$container
;
57
$this->key =
$key
;
58
$this->value =
$value
;
59
$this->version =
$version
;
60
}
61
68
public
function
getContainer
()
69
{
70
if
(is_null($this->container)) {
72
$data = $this->
raw
(self::FIELD_CONTAINER);
73
if
(is_null($data)) {
74
return
null
;
75
}
76
$this->container = (string) $data;
77
}
78
79
return
$this->container
;
80
}
81
88
public
function
getKey
()
89
{
90
if
(is_null($this->key)) {
92
$data = $this->
raw
(self::FIELD_KEY);
93
if
(is_null($data)) {
94
return
null
;
95
}
96
$this->key = (string) $data;
97
}
98
99
return
$this->key
;
100
}
101
112
public
function
getValue
()
113
{
114
if
(is_null($this->value)) {
116
$data = $this->
raw
(self::FIELD_VALUE);
117
if
(is_null($data)) {
118
return
null
;
119
}
120
$this->value = $data;
121
}
122
123
return
$this->value
;
124
}
125
132
public
function
getVersion
()
133
{
134
if
(is_null($this->version)) {
136
$data = $this->
raw
(self::FIELD_VERSION);
137
if
(is_null($data)) {
138
return
null
;
139
}
140
$this->version = (int) $data;
141
}
142
143
return
$this->version
;
144
}
145
146
150
public
function
setContainer
(?
string
$container
): void
151
{
152
$this->container =
$container
;
153
}
154
158
public
function
setKey
(?
string
$key
): void
159
{
160
$this->key =
$key
;
161
}
162
166
public
function
setValue
(
$value
): void
167
{
168
$this->value =
$value
;
169
}
170
174
public
function
setVersion
(?
int
$version
): void
175
{
176
$this->version =
$version
;
177
}
178
}
Commercetools\Api\Models\CustomObject\CustomObjectDraftModel
Definition
CustomObjectDraftModel.php:21
Commercetools\Api\Models\CustomObject\CustomObjectDraftModel\getContainer
getContainer()
Definition
CustomObjectDraftModel.php:68
Commercetools\Api\Models\CustomObject\CustomObjectDraftModel\$key
$key
Definition
CustomObjectDraftModel.php:32
Commercetools\Api\Models\CustomObject\CustomObjectDraftModel\getVersion
getVersion()
Definition
CustomObjectDraftModel.php:132
Commercetools\Api\Models\CustomObject\CustomObjectDraftModel\$container
$container
Definition
CustomObjectDraftModel.php:26
Commercetools\Api\Models\CustomObject\CustomObjectDraftModel\setContainer
setContainer(?string $container)
Definition
CustomObjectDraftModel.php:150
Commercetools\Api\Models\CustomObject\CustomObjectDraftModel\$value
$value
Definition
CustomObjectDraftModel.php:38
Commercetools\Api\Models\CustomObject\CustomObjectDraftModel\setValue
setValue($value)
Definition
CustomObjectDraftModel.php:166
Commercetools\Api\Models\CustomObject\CustomObjectDraftModel\getValue
getValue()
Definition
CustomObjectDraftModel.php:112
Commercetools\Api\Models\CustomObject\CustomObjectDraftModel\setKey
setKey(?string $key)
Definition
CustomObjectDraftModel.php:158
Commercetools\Api\Models\CustomObject\CustomObjectDraftModel\getKey
getKey()
Definition
CustomObjectDraftModel.php:88
Commercetools\Api\Models\CustomObject\CustomObjectDraftModel\__construct
__construct(?string $container=null, ?string $key=null, $value=null, ?int $version=null)
Definition
CustomObjectDraftModel.php:50
Commercetools\Api\Models\CustomObject\CustomObjectDraftModel\$version
$version
Definition
CustomObjectDraftModel.php:44
Commercetools\Api\Models\CustomObject\CustomObjectDraftModel\setVersion
setVersion(?int $version)
Definition
CustomObjectDraftModel.php:174
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\Api\Models\CustomObject\CustomObjectDraft
Definition
CustomObjectDraft.php:15
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\CustomObject
Definition
CustomObject.php:9
Generated by
1.9.8