commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
VariantSetAttributeActionModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = 'setAttribute';
27 protected $action;
28
33 protected $name;
34
39 protected $value;
40
45 protected $staged;
46
47
51 public function __construct(
52 ?string $name = null,
53 $value = null,
54 ?bool $staged = null,
55 ?string $action = null
56 ) {
57 $this->name = $name;
58 $this->value = $value;
59 $this->staged = $staged;
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 getName()
88 {
89 if (is_null($this->name)) {
91 $data = $this->raw(self::FIELD_NAME);
92 if (is_null($data)) {
93 return null;
94 }
95 $this->name = (string) $data;
96 }
97
98 return $this->name;
99 }
100
116 public function getValue()
117 {
118 if (is_null($this->value)) {
120 $data = $this->raw(self::FIELD_VALUE);
121 if (is_null($data)) {
122 return null;
123 }
124 $this->value = $data;
125 }
126
127 return $this->value;
128 }
129
136 public function getStaged()
137 {
138 if (is_null($this->staged)) {
140 $data = $this->raw(self::FIELD_STAGED);
141 if (is_null($data)) {
142 return null;
143 }
144 $this->staged = (bool) $data;
145 }
146
147 return $this->staged;
148 }
149
150
154 public function setName(?string $name): void
155 {
156 $this->name = $name;
157 }
158
162 public function setValue($value): void
163 {
164 $this->value = $value;
165 }
166
170 public function setStaged(?bool $staged): void
171 {
172 $this->staged = $staged;
173 }
174}
__construct(?string $name=null, $value=null, ?bool $staged=null, ?string $action=null)