commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
VariantChangeAssetNameActionModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
24 public const DISCRIMINATOR_VALUE = 'changeAssetName';
29 protected $action;
30
35 protected $staged;
36
41 protected $assetId;
42
47 protected $assetKey;
48
53 protected $name;
54
55
59 public function __construct(
60 ?bool $staged = null,
61 ?string $assetId = null,
62 ?string $assetKey = null,
63 ?LocalizedString $name = null,
64 ?string $action = null
65 ) {
66 $this->staged = $staged;
67 $this->assetId = $assetId;
68 $this->assetKey = $assetKey;
69 $this->name = $name;
70 $this->action = $action ?? self::DISCRIMINATOR_VALUE;
71 }
72
77 public function getAction()
78 {
79 if (is_null($this->action)) {
81 $data = $this->raw(self::FIELD_ACTION);
82 if (is_null($data)) {
83 return null;
84 }
85 $this->action = (string) $data;
86 }
87
88 return $this->action;
89 }
90
97 public function getStaged()
98 {
99 if (is_null($this->staged)) {
101 $data = $this->raw(self::FIELD_STAGED);
102 if (is_null($data)) {
103 return null;
104 }
105 $this->staged = (bool) $data;
106 }
107
108 return $this->staged;
109 }
110
117 public function getAssetId()
118 {
119 if (is_null($this->assetId)) {
121 $data = $this->raw(self::FIELD_ASSET_ID);
122 if (is_null($data)) {
123 return null;
124 }
125 $this->assetId = (string) $data;
126 }
127
128 return $this->assetId;
129 }
130
137 public function getAssetKey()
138 {
139 if (is_null($this->assetKey)) {
141 $data = $this->raw(self::FIELD_ASSET_KEY);
142 if (is_null($data)) {
143 return null;
144 }
145 $this->assetKey = (string) $data;
146 }
147
148 return $this->assetKey;
149 }
150
157 public function getName()
158 {
159 if (is_null($this->name)) {
161 $data = $this->raw(self::FIELD_NAME);
162 if (is_null($data)) {
163 return null;
164 }
165
166 $this->name = LocalizedStringModel::of($data);
167 }
168
169 return $this->name;
170 }
171
172
176 public function setStaged(?bool $staged): void
177 {
178 $this->staged = $staged;
179 }
180
184 public function setAssetId(?string $assetId): void
185 {
186 $this->assetId = $assetId;
187 }
188
192 public function setAssetKey(?string $assetKey): void
193 {
194 $this->assetKey = $assetKey;
195 }
196
200 public function setName(?LocalizedString $name): void
201 {
202 $this->name = $name;
203 }
204}
__construct(?bool $staged=null, ?string $assetId=null, ?string $assetKey=null, ?LocalizedString $name=null, ?string $action=null)