commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
State
StateUpdateModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\State
;
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
StateUpdateModel
extends
JsonObjectModel
implements
StateUpdate
21
{
26
protected
$version
;
27
32
protected
$actions
;
33
34
38
public
function
__construct
(
39
?
int
$version
=
null
,
40
?
StateUpdateActionCollection
$actions
=
null
41
) {
42
$this->version =
$version
;
43
$this->actions =
$actions
;
44
}
45
53
public
function
getVersion
()
54
{
55
if
(is_null($this->version)) {
57
$data = $this->
raw
(self::FIELD_VERSION);
58
if
(is_null($data)) {
59
return
null
;
60
}
61
$this->version = (int) $data;
62
}
63
64
return
$this->version
;
65
}
66
73
public
function
getActions
()
74
{
75
if
(is_null($this->actions)) {
77
$data = $this->
raw
(self::FIELD_ACTIONS);
78
if
(is_null($data)) {
79
return
null
;
80
}
81
$this->actions =
StateUpdateActionCollection::fromArray
($data);
82
}
83
84
return
$this->actions
;
85
}
86
87
91
public
function
setVersion
(?
int
$version
): void
92
{
93
$this->version =
$version
;
94
}
95
99
public
function
setActions
(?
StateUpdateActionCollection
$actions
): void
100
{
101
$this->actions =
$actions
;
102
}
103
}
Commercetools\Api\Models\State\StateUpdateActionCollection
Definition:
StateUpdateActionCollection.php:26
Commercetools\Api\Models\State\StateUpdateModel
Definition:
StateUpdateModel.php:21
Commercetools\Api\Models\State\StateUpdateModel\__construct
__construct(?int $version=null, ?StateUpdateActionCollection $actions=null)
Definition:
StateUpdateModel.php:38
Commercetools\Api\Models\State\StateUpdateModel\$version
$version
Definition:
StateUpdateModel.php:26
Commercetools\Api\Models\State\StateUpdateModel\getVersion
getVersion()
Definition:
StateUpdateModel.php:53
Commercetools\Api\Models\State\StateUpdateModel\setActions
setActions(?StateUpdateActionCollection $actions)
Definition:
StateUpdateModel.php:99
Commercetools\Api\Models\State\StateUpdateModel\setVersion
setVersion(?int $version)
Definition:
StateUpdateModel.php:91
Commercetools\Api\Models\State\StateUpdateModel\getActions
getActions()
Definition:
StateUpdateModel.php:73
Commercetools\Api\Models\State\StateUpdateModel\$actions
$actions
Definition:
StateUpdateModel.php:32
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\MapperSequence\fromArray
static fromArray(array $data)
Definition:
MapperSequence.php:56
Commercetools\Api\Models\State\StateUpdate
Definition:
StateUpdate.php:15
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\State
Definition:
State.php:9
Generated by
1.9.1