commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
AttributeDefinitionDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
24{
29 private $type;
30
35 private $name;
36
41 private $label;
42
47 private $isRequired;
48
53 private $level;
54
59 private $attributeConstraint;
60
65 private $inputTip;
66
71 private $inputHint;
72
77 private $isSearchable;
78
83 private $savedToLineItem;
84
92 public function getType()
93 {
94 return $this->type instanceof AttributeTypeBuilder ? $this->type->build() : $this->type;
95 }
96
105 public function getName()
106 {
107 return $this->name;
108 }
109
116 public function getLabel()
117 {
118 return $this->label instanceof LocalizedStringBuilder ? $this->label->build() : $this->label;
119 }
120
127 public function getIsRequired()
128 {
129 return $this->isRequired;
130 }
131
138 public function getLevel()
139 {
140 return $this->level;
141 }
142
150 public function getAttributeConstraint()
151 {
152 return $this->attributeConstraint;
153 }
154
161 public function getInputTip()
162 {
163 return $this->inputTip instanceof LocalizedStringBuilder ? $this->inputTip->build() : $this->inputTip;
164 }
165
172 public function getInputHint()
173 {
174 return $this->inputHint;
175 }
176
190 public function getIsSearchable()
191 {
192 return $this->isSearchable;
193 }
194
203 public function getSavedToLineItem()
204 {
205 return $this->savedToLineItem;
206 }
207
212 public function withType(?AttributeType $type)
213 {
214 $this->type = $type;
215
216 return $this;
217 }
218
223 public function withName(?string $name)
224 {
225 $this->name = $name;
226
227 return $this;
228 }
229
234 public function withLabel(?LocalizedString $label)
235 {
236 $this->label = $label;
237
238 return $this;
239 }
240
245 public function withIsRequired(?bool $isRequired)
246 {
247 $this->isRequired = $isRequired;
248
249 return $this;
250 }
251
256 public function withLevel(?string $level)
257 {
258 $this->level = $level;
259
260 return $this;
261 }
262
267 public function withAttributeConstraint(?string $attributeConstraint)
268 {
269 $this->attributeConstraint = $attributeConstraint;
270
271 return $this;
272 }
273
278 public function withInputTip(?LocalizedString $inputTip)
279 {
280 $this->inputTip = $inputTip;
281
282 return $this;
283 }
284
289 public function withInputHint(?string $inputHint)
290 {
291 $this->inputHint = $inputHint;
292
293 return $this;
294 }
295
300 public function withIsSearchable(?bool $isSearchable)
301 {
302 $this->isSearchable = $isSearchable;
303
304 return $this;
305 }
306
311 public function withSavedToLineItem(?bool $savedToLineItem)
312 {
313 $this->savedToLineItem = $savedToLineItem;
314
315 return $this;
316 }
317
322 public function withTypeBuilder(?AttributeTypeBuilder $type)
323 {
324 $this->type = $type;
325
326 return $this;
327 }
328
334 {
335 $this->label = $label;
336
337 return $this;
338 }
339
344 public function withInputTipBuilder(?LocalizedStringBuilder $inputTip)
345 {
346 $this->inputTip = $inputTip;
347
348 return $this;
349 }
350
352 {
354 $this->type instanceof AttributeTypeBuilder ? $this->type->build() : $this->type,
355 $this->name,
356 $this->label instanceof LocalizedStringBuilder ? $this->label->build() : $this->label,
357 $this->isRequired,
358 $this->level,
359 $this->attributeConstraint,
360 $this->inputTip instanceof LocalizedStringBuilder ? $this->inputTip->build() : $this->inputTip,
361 $this->inputHint,
362 $this->isSearchable,
363 $this->savedToLineItem
364 );
365 }
366
367 public static function of(): AttributeDefinitionDraftBuilder
368 {
369 return new self();
370 }
371}