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
86 public function getType()
87 {
88 return $this->type instanceof AttributeTypeBuilder ? $this->type->build() : $this->type;
89 }
90
99 public function getName()
100 {
101 return $this->name;
102 }
103
110 public function getLabel()
111 {
112 return $this->label instanceof LocalizedStringBuilder ? $this->label->build() : $this->label;
113 }
114
121 public function getIsRequired()
122 {
123 return $this->isRequired;
124 }
125
132 public function getLevel()
133 {
134 return $this->level;
135 }
136
144 public function getAttributeConstraint()
145 {
146 return $this->attributeConstraint;
147 }
148
155 public function getInputTip()
156 {
157 return $this->inputTip instanceof LocalizedStringBuilder ? $this->inputTip->build() : $this->inputTip;
158 }
159
166 public function getInputHint()
167 {
168 return $this->inputHint;
169 }
170
182 public function getIsSearchable()
183 {
184 return $this->isSearchable;
185 }
186
191 public function withType(?AttributeType $type)
192 {
193 $this->type = $type;
194
195 return $this;
196 }
197
202 public function withName(?string $name)
203 {
204 $this->name = $name;
205
206 return $this;
207 }
208
213 public function withLabel(?LocalizedString $label)
214 {
215 $this->label = $label;
216
217 return $this;
218 }
219
224 public function withIsRequired(?bool $isRequired)
225 {
226 $this->isRequired = $isRequired;
227
228 return $this;
229 }
230
235 public function withLevel(?string $level)
236 {
237 $this->level = $level;
238
239 return $this;
240 }
241
246 public function withAttributeConstraint(?string $attributeConstraint)
247 {
248 $this->attributeConstraint = $attributeConstraint;
249
250 return $this;
251 }
252
257 public function withInputTip(?LocalizedString $inputTip)
258 {
259 $this->inputTip = $inputTip;
260
261 return $this;
262 }
263
268 public function withInputHint(?string $inputHint)
269 {
270 $this->inputHint = $inputHint;
271
272 return $this;
273 }
274
279 public function withIsSearchable(?bool $isSearchable)
280 {
281 $this->isSearchable = $isSearchable;
282
283 return $this;
284 }
285
290 public function withTypeBuilder(?AttributeTypeBuilder $type)
291 {
292 $this->type = $type;
293
294 return $this;
295 }
296
302 {
303 $this->label = $label;
304
305 return $this;
306 }
307
312 public function withInputTipBuilder(?LocalizedStringBuilder $inputTip)
313 {
314 $this->inputTip = $inputTip;
315
316 return $this;
317 }
318
320 {
322 $this->type instanceof AttributeTypeBuilder ? $this->type->build() : $this->type,
323 $this->name,
324 $this->label instanceof LocalizedStringBuilder ? $this->label->build() : $this->label,
325 $this->isRequired,
326 $this->level,
327 $this->attributeConstraint,
328 $this->inputTip instanceof LocalizedStringBuilder ? $this->inputTip->build() : $this->inputTip,
329 $this->inputHint,
330 $this->isSearchable
331 );
332 }
333
334 public static function of(): AttributeDefinitionDraftBuilder
335 {
336 return new self();
337 }
338}