commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ProductUpdateModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
20final class ProductUpdateModel extends JsonObjectModel implements ProductUpdate
21{
26 protected $version;
27
32 protected $actions;
33
34
38 public function __construct(
39 ?int $version = 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 = ProductUpdateActionCollection::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
100 {
101 $this->actions = $actions;
102 }
103}
__construct(?int $version=null, ?ProductUpdateActionCollection $actions=null)
setActions(?ProductUpdateActionCollection $actions)
static fromArray(array $data)