commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
ProductSelection
ProductSelectionUpdateModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\ProductSelection
;
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
ProductSelectionUpdateModel
extends
JsonObjectModel
implements
ProductSelectionUpdate
21
{
26
protected
$version
;
27
32
protected
$actions
;
33
34
38
public
function
__construct
(
39
?
int
$version
=
null
,
40
?
ProductSelectionUpdateActionCollection
$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 =
ProductSelectionUpdateActionCollection::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
(?
ProductSelectionUpdateActionCollection
$actions
): void
95
{
96
$this->actions =
$actions
;
97
}
98
}
Commercetools\Api\Models\ProductSelection\ProductSelectionUpdateActionCollection
Definition:
ProductSelectionUpdateActionCollection.php:26
Commercetools\Api\Models\ProductSelection\ProductSelectionUpdateModel
Definition:
ProductSelectionUpdateModel.php:21
Commercetools\Api\Models\ProductSelection\ProductSelectionUpdateModel\getVersion
getVersion()
Definition:
ProductSelectionUpdateModel.php:50
Commercetools\Api\Models\ProductSelection\ProductSelectionUpdateModel\getActions
getActions()
Definition:
ProductSelectionUpdateModel.php:68
Commercetools\Api\Models\ProductSelection\ProductSelectionUpdateModel\__construct
__construct(?int $version=null, ?ProductSelectionUpdateActionCollection $actions=null)
Definition:
ProductSelectionUpdateModel.php:38
Commercetools\Api\Models\ProductSelection\ProductSelectionUpdateModel\$version
$version
Definition:
ProductSelectionUpdateModel.php:26
Commercetools\Api\Models\ProductSelection\ProductSelectionUpdateModel\$actions
$actions
Definition:
ProductSelectionUpdateModel.php:32
Commercetools\Api\Models\ProductSelection\ProductSelectionUpdateModel\setActions
setActions(?ProductSelectionUpdateActionCollection $actions)
Definition:
ProductSelectionUpdateModel.php:94
Commercetools\Api\Models\ProductSelection\ProductSelectionUpdateModel\setVersion
setVersion(?int $version)
Definition:
ProductSelectionUpdateModel.php:86
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\ProductSelection\ProductSelectionUpdate
Definition:
ProductSelectionUpdate.php:15
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\ProductSelection
Definition:
AssignedProductReference.php:9
Generated by
1.9.1