commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
VariantRemoveAssetActionModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = 'removeAsset';
27 protected $action;
28
33 protected $staged;
34
39 protected $assetId;
40
45 protected $assetKey;
46
47
51 public function __construct(
52 ?bool $staged = null,
53 ?string $assetId = null,
54 ?string $assetKey = null,
55 ?string $action = null
56 ) {
57 $this->staged = $staged;
58 $this->assetId = $assetId;
59 $this->assetKey = $assetKey;
60 $this->action = $action ?? self::DISCRIMINATOR_VALUE;
61 }
62
67 public function getAction()
68 {
69 if (is_null($this->action)) {
71 $data = $this->raw(self::FIELD_ACTION);
72 if (is_null($data)) {
73 return null;
74 }
75 $this->action = (string) $data;
76 }
77
78 return $this->action;
79 }
80
87 public function getStaged()
88 {
89 if (is_null($this->staged)) {
91 $data = $this->raw(self::FIELD_STAGED);
92 if (is_null($data)) {
93 return null;
94 }
95 $this->staged = (bool) $data;
96 }
97
98 return $this->staged;
99 }
100
107 public function getAssetId()
108 {
109 if (is_null($this->assetId)) {
111 $data = $this->raw(self::FIELD_ASSET_ID);
112 if (is_null($data)) {
113 return null;
114 }
115 $this->assetId = (string) $data;
116 }
117
118 return $this->assetId;
119 }
120
127 public function getAssetKey()
128 {
129 if (is_null($this->assetKey)) {
131 $data = $this->raw(self::FIELD_ASSET_KEY);
132 if (is_null($data)) {
133 return null;
134 }
135 $this->assetKey = (string) $data;
136 }
137
138 return $this->assetKey;
139 }
140
141
145 public function setStaged(?bool $staged): void
146 {
147 $this->staged = $staged;
148 }
149
153 public function setAssetId(?string $assetId): void
154 {
155 $this->assetId = $assetId;
156 }
157
161 public function setAssetKey(?string $assetKey): void
162 {
163 $this->assetKey = $assetKey;
164 }
165}
__construct(?bool $staged=null, ?string $assetId=null, ?string $assetKey=null, ?string $action=null)