commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
VariantSetAssetSourcesActionModel.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
22{
23 public const DISCRIMINATOR_VALUE = 'setAssetSources';
28 protected $action;
29
34 protected $staged;
35
40 protected $assetId;
41
46 protected $assetKey;
47
52 protected $sources;
53
54
58 public function __construct(
59 ?bool $staged = null,
60 ?string $assetId = null,
61 ?string $assetKey = null,
63 ?string $action = null
64 ) {
65 $this->staged = $staged;
66 $this->assetId = $assetId;
67 $this->assetKey = $assetKey;
68 $this->sources = $sources;
69 $this->action = $action ?? self::DISCRIMINATOR_VALUE;
70 }
71
76 public function getAction()
77 {
78 if (is_null($this->action)) {
80 $data = $this->raw(self::FIELD_ACTION);
81 if (is_null($data)) {
82 return null;
83 }
84 $this->action = (string) $data;
85 }
86
87 return $this->action;
88 }
89
96 public function getStaged()
97 {
98 if (is_null($this->staged)) {
100 $data = $this->raw(self::FIELD_STAGED);
101 if (is_null($data)) {
102 return null;
103 }
104 $this->staged = (bool) $data;
105 }
106
107 return $this->staged;
108 }
109
116 public function getAssetId()
117 {
118 if (is_null($this->assetId)) {
120 $data = $this->raw(self::FIELD_ASSET_ID);
121 if (is_null($data)) {
122 return null;
123 }
124 $this->assetId = (string) $data;
125 }
126
127 return $this->assetId;
128 }
129
136 public function getAssetKey()
137 {
138 if (is_null($this->assetKey)) {
140 $data = $this->raw(self::FIELD_ASSET_KEY);
141 if (is_null($data)) {
142 return null;
143 }
144 $this->assetKey = (string) $data;
145 }
146
147 return $this->assetKey;
148 }
149
156 public function getSources()
157 {
158 if (is_null($this->sources)) {
160 $data = $this->raw(self::FIELD_SOURCES);
161 if (is_null($data)) {
162 return null;
163 }
164 $this->sources = AssetSourceCollection::fromArray($data);
165 }
166
167 return $this->sources;
168 }
169
170
174 public function setStaged(?bool $staged): void
175 {
176 $this->staged = $staged;
177 }
178
182 public function setAssetId(?string $assetId): void
183 {
184 $this->assetId = $assetId;
185 }
186
190 public function setAssetKey(?string $assetKey): void
191 {
192 $this->assetKey = $assetKey;
193 }
194
199 {
200 $this->sources = $sources;
201 }
202}
__construct(?bool $staged=null, ?string $assetId=null, ?string $assetKey=null, ?AssetSourceCollection $sources=null, ?string $action=null)