commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
AttributeDefinitionDraftModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
28 protected $type;
29
34 protected $name;
35
40 protected $label;
41
46 protected $isRequired;
47
52 protected $level;
53
59
64 protected $inputTip;
65
70 protected $inputHint;
71
76 protected $isSearchable;
77
83
84
88 public function __construct(
89 ?AttributeType $type = null,
90 ?string $name = null,
91 ?LocalizedString $label = null,
92 ?bool $isRequired = null,
93 ?string $level = null,
94 ?string $attributeConstraint = null,
96 ?string $inputHint = null,
97 ?bool $isSearchable = null,
98 ?bool $savedToLineItem = null
99 ) {
100 $this->type = $type;
101 $this->name = $name;
102 $this->label = $label;
103 $this->isRequired = $isRequired;
104 $this->level = $level;
105 $this->attributeConstraint = $attributeConstraint;
106 $this->inputTip = $inputTip;
107 $this->inputHint = $inputHint;
108 $this->isSearchable = $isSearchable;
109 $this->savedToLineItem = $savedToLineItem;
110 }
111
119 public function getType()
120 {
121 if (is_null($this->type)) {
123 $data = $this->raw(self::FIELD_TYPE);
124 if (is_null($data)) {
125 return null;
126 }
128 $this->type = $className::of($data);
129 }
130
131 return $this->type;
132 }
133
142 public function getName()
143 {
144 if (is_null($this->name)) {
146 $data = $this->raw(self::FIELD_NAME);
147 if (is_null($data)) {
148 return null;
149 }
150 $this->name = (string) $data;
151 }
152
153 return $this->name;
154 }
155
162 public function getLabel()
163 {
164 if (is_null($this->label)) {
166 $data = $this->raw(self::FIELD_LABEL);
167 if (is_null($data)) {
168 return null;
169 }
170
171 $this->label = LocalizedStringModel::of($data);
172 }
173
174 return $this->label;
175 }
176
183 public function getIsRequired()
184 {
185 if (is_null($this->isRequired)) {
187 $data = $this->raw(self::FIELD_IS_REQUIRED);
188 if (is_null($data)) {
189 return null;
190 }
191 $this->isRequired = (bool) $data;
192 }
193
194 return $this->isRequired;
195 }
196
203 public function getLevel()
204 {
205 if (is_null($this->level)) {
207 $data = $this->raw(self::FIELD_LEVEL);
208 if (is_null($data)) {
209 return null;
210 }
211 $this->level = (string) $data;
212 }
213
214 return $this->level;
215 }
216
224 public function getAttributeConstraint()
225 {
226 if (is_null($this->attributeConstraint)) {
228 $data = $this->raw(self::FIELD_ATTRIBUTE_CONSTRAINT);
229 if (is_null($data)) {
230 return null;
231 }
232 $this->attributeConstraint = (string) $data;
233 }
234
236 }
237
244 public function getInputTip()
245 {
246 if (is_null($this->inputTip)) {
248 $data = $this->raw(self::FIELD_INPUT_TIP);
249 if (is_null($data)) {
250 return null;
251 }
252
253 $this->inputTip = LocalizedStringModel::of($data);
254 }
255
256 return $this->inputTip;
257 }
258
265 public function getInputHint()
266 {
267 if (is_null($this->inputHint)) {
269 $data = $this->raw(self::FIELD_INPUT_HINT);
270 if (is_null($data)) {
271 return null;
272 }
273 $this->inputHint = (string) $data;
274 }
275
276 return $this->inputHint;
277 }
278
292 public function getIsSearchable()
293 {
294 if (is_null($this->isSearchable)) {
296 $data = $this->raw(self::FIELD_IS_SEARCHABLE);
297 if (is_null($data)) {
298 return null;
299 }
300 $this->isSearchable = (bool) $data;
301 }
302
303 return $this->isSearchable;
304 }
305
314 public function getSavedToLineItem()
315 {
316 if (is_null($this->savedToLineItem)) {
318 $data = $this->raw(self::FIELD_SAVED_TO_LINE_ITEM);
319 if (is_null($data)) {
320 return null;
321 }
322 $this->savedToLineItem = (bool) $data;
323 }
324
326 }
327
328
332 public function setType(?AttributeType $type): void
333 {
334 $this->type = $type;
335 }
336
340 public function setName(?string $name): void
341 {
342 $this->name = $name;
343 }
344
348 public function setLabel(?LocalizedString $label): void
349 {
350 $this->label = $label;
351 }
352
356 public function setIsRequired(?bool $isRequired): void
357 {
358 $this->isRequired = $isRequired;
359 }
360
364 public function setLevel(?string $level): void
365 {
366 $this->level = $level;
367 }
368
372 public function setAttributeConstraint(?string $attributeConstraint): void
373 {
374 $this->attributeConstraint = $attributeConstraint;
375 }
376
380 public function setInputTip(?LocalizedString $inputTip): void
381 {
382 $this->inputTip = $inputTip;
383 }
384
388 public function setInputHint(?string $inputHint): void
389 {
390 $this->inputHint = $inputHint;
391 }
392
396 public function setIsSearchable(?bool $isSearchable): void
397 {
398 $this->isSearchable = $isSearchable;
399 }
400
404 public function setSavedToLineItem(?bool $savedToLineItem): void
405 {
406 $this->savedToLineItem = $savedToLineItem;
407 }
408}
__construct(?AttributeType $type=null, ?string $name=null, ?LocalizedString $label=null, ?bool $isRequired=null, ?string $level=null, ?string $attributeConstraint=null, ?LocalizedString $inputTip=null, ?string $inputHint=null, ?bool $isSearchable=null, ?bool $savedToLineItem=null)