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
78
82 public function __construct(
83 ?AttributeType $type = null,
84 ?string $name = null,
85 ?LocalizedString $label = null,
86 ?bool $isRequired = null,
87 ?string $level = null,
88 ?string $attributeConstraint = null,
90 ?string $inputHint = null,
91 ?bool $isSearchable = null
92 ) {
93 $this->type = $type;
94 $this->name = $name;
95 $this->label = $label;
96 $this->isRequired = $isRequired;
97 $this->level = $level;
98 $this->attributeConstraint = $attributeConstraint;
99 $this->inputTip = $inputTip;
100 $this->inputHint = $inputHint;
101 $this->isSearchable = $isSearchable;
102 }
103
111 public function getType()
112 {
113 if (is_null($this->type)) {
115 $data = $this->raw(self::FIELD_TYPE);
116 if (is_null($data)) {
117 return null;
118 }
120 $this->type = $className::of($data);
121 }
122
123 return $this->type;
124 }
125
134 public function getName()
135 {
136 if (is_null($this->name)) {
138 $data = $this->raw(self::FIELD_NAME);
139 if (is_null($data)) {
140 return null;
141 }
142 $this->name = (string) $data;
143 }
144
145 return $this->name;
146 }
147
154 public function getLabel()
155 {
156 if (is_null($this->label)) {
158 $data = $this->raw(self::FIELD_LABEL);
159 if (is_null($data)) {
160 return null;
161 }
162
163 $this->label = LocalizedStringModel::of($data);
164 }
165
166 return $this->label;
167 }
168
175 public function getIsRequired()
176 {
177 if (is_null($this->isRequired)) {
179 $data = $this->raw(self::FIELD_IS_REQUIRED);
180 if (is_null($data)) {
181 return null;
182 }
183 $this->isRequired = (bool) $data;
184 }
185
186 return $this->isRequired;
187 }
188
195 public function getLevel()
196 {
197 if (is_null($this->level)) {
199 $data = $this->raw(self::FIELD_LEVEL);
200 if (is_null($data)) {
201 return null;
202 }
203 $this->level = (string) $data;
204 }
205
206 return $this->level;
207 }
208
216 public function getAttributeConstraint()
217 {
218 if (is_null($this->attributeConstraint)) {
220 $data = $this->raw(self::FIELD_ATTRIBUTE_CONSTRAINT);
221 if (is_null($data)) {
222 return null;
223 }
224 $this->attributeConstraint = (string) $data;
225 }
226
228 }
229
236 public function getInputTip()
237 {
238 if (is_null($this->inputTip)) {
240 $data = $this->raw(self::FIELD_INPUT_TIP);
241 if (is_null($data)) {
242 return null;
243 }
244
245 $this->inputTip = LocalizedStringModel::of($data);
246 }
247
248 return $this->inputTip;
249 }
250
257 public function getInputHint()
258 {
259 if (is_null($this->inputHint)) {
261 $data = $this->raw(self::FIELD_INPUT_HINT);
262 if (is_null($data)) {
263 return null;
264 }
265 $this->inputHint = (string) $data;
266 }
267
268 return $this->inputHint;
269 }
270
282 public function getIsSearchable()
283 {
284 if (is_null($this->isSearchable)) {
286 $data = $this->raw(self::FIELD_IS_SEARCHABLE);
287 if (is_null($data)) {
288 return null;
289 }
290 $this->isSearchable = (bool) $data;
291 }
292
293 return $this->isSearchable;
294 }
295
296
300 public function setType(?AttributeType $type): void
301 {
302 $this->type = $type;
303 }
304
308 public function setName(?string $name): void
309 {
310 $this->name = $name;
311 }
312
316 public function setLabel(?LocalizedString $label): void
317 {
318 $this->label = $label;
319 }
320
324 public function setIsRequired(?bool $isRequired): void
325 {
326 $this->isRequired = $isRequired;
327 }
328
332 public function setLevel(?string $level): void
333 {
334 $this->level = $level;
335 }
336
340 public function setAttributeConstraint(?string $attributeConstraint): void
341 {
342 $this->attributeConstraint = $attributeConstraint;
343 }
344
348 public function setInputTip(?LocalizedString $inputTip): void
349 {
350 $this->inputTip = $inputTip;
351 }
352
356 public function setInputHint(?string $inputHint): void
357 {
358 $this->inputHint = $inputHint;
359 }
360
364 public function setIsSearchable(?bool $isSearchable): void
365 {
366 $this->isSearchable = $isSearchable;
367 }
368}
__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)