commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Common
UpdateModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Common
;
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
UpdateModel
extends
JsonObjectModel
implements
Update
21
{
26
protected
$version
;
27
32
protected
$actions
;
33
34
38
public
function
__construct
(
39
?
int
$version
=
null
,
40
?
UpdateActionCollection
$actions
=
null
41
) {
42
$this->version =
$version
;
43
$this->actions =
$actions
;
44
}
45
50
public
function
getVersion
()
51
{
52
if
(is_null($this->version)) {
54
$data = $this->
raw
(self::FIELD_VERSION);
55
if
(is_null($data)) {
56
return
null
;
57
}
58
$this->version = (int) $data;
59
}
60
61
return
$this->version
;
62
}
63
68
public
function
getActions
()
69
{
70
if
(is_null($this->actions)) {
72
$data = $this->
raw
(self::FIELD_ACTIONS);
73
if
(is_null($data)) {
74
return
null
;
75
}
76
$this->actions =
UpdateActionCollection::fromArray
($data);
77
}
78
79
return
$this->actions
;
80
}
81
82
86
public
function
setVersion
(?
int
$version
): void
87
{
88
$this->version =
$version
;
89
}
90
94
public
function
setActions
(?
UpdateActionCollection
$actions
): void
95
{
96
$this->actions =
$actions
;
97
}
98
}
Commercetools\Api\Models\Common\UpdateActionCollection
Definition:
UpdateActionCollection.php:22
Commercetools\Api\Models\Common\UpdateModel
Definition:
UpdateModel.php:21
Commercetools\Api\Models\Common\UpdateModel\$actions
$actions
Definition:
UpdateModel.php:32
Commercetools\Api\Models\Common\UpdateModel\$version
$version
Definition:
UpdateModel.php:26
Commercetools\Api\Models\Common\UpdateModel\getVersion
getVersion()
Definition:
UpdateModel.php:50
Commercetools\Api\Models\Common\UpdateModel\__construct
__construct(?int $version=null, ?UpdateActionCollection $actions=null)
Definition:
UpdateModel.php:38
Commercetools\Api\Models\Common\UpdateModel\setActions
setActions(?UpdateActionCollection $actions)
Definition:
UpdateModel.php:94
Commercetools\Api\Models\Common\UpdateModel\setVersion
setVersion(?int $version)
Definition:
UpdateModel.php:86
Commercetools\Api\Models\Common\UpdateModel\getActions
getActions()
Definition:
UpdateModel.php:68
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\Common\Update
Definition:
Update.php:15
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Common
Definition:
Address.php:9
Generated by
1.9.1