| @@ 46-57 (lines=12) @@ | ||
| 43 | * @throws InvalidArgumentException If the type is not a string. |
|
| 44 | * @return UiItemConfig Chainable |
|
| 45 | */ |
|
| 46 | public function setType($type) |
|
| 47 | { |
|
| 48 | if (is_string($type) || $type === null) { |
|
| 49 | $this->type = $type; |
|
| 50 | } else { |
|
| 51 | throw new InvalidArgumentException( |
|
| 52 | 'Can not set UI item config type: Type must be a string or NULL' |
|
| 53 | ); |
|
| 54 | } |
|
| 55 | ||
| 56 | return $this; |
|
| 57 | } |
|
| 58 | ||
| 59 | /** |
|
| 60 | * Retrieve the UI item type. |
|
| @@ 158-169 (lines=12) @@ | ||
| 155 | * @throws InvalidArgumentException If the type is not a string (or null). |
|
| 156 | * @return self |
|
| 157 | */ |
|
| 158 | public function setType($type) |
|
| 159 | { |
|
| 160 | if (is_string($type) || $type === null) { |
|
| 161 | $this->type = $type; |
|
| 162 | } else { |
|
| 163 | throw new InvalidArgumentException( |
|
| 164 | 'Can not set UI item config type: Type must be a string or NULL' |
|
| 165 | ); |
|
| 166 | } |
|
| 167 | ||
| 168 | return $this; |
|
| 169 | } |
|
| 170 | ||
| 171 | /** |
|
| 172 | * Retrieve the UI item type. |
|
| @@ 578-588 (lines=11) @@ | ||
| 575 | * @throws InvalidArgumentException If the key argument is not a string. |
|
| 576 | * @return FormInterface Chainable |
|
| 577 | */ |
|
| 578 | public function addFormData($key, $val) |
|
| 579 | { |
|
| 580 | if (!is_string($key)) { |
|
| 581 | throw new InvalidArgumentException( |
|
| 582 | 'Can not add form data: Data key must be a string' |
|
| 583 | ); |
|
| 584 | } |
|
| 585 | $this->formData[$key] = $val; |
|
| 586 | ||
| 587 | return $this; |
|
| 588 | } |
|
| 589 | ||
| 590 | /** |
|
| 591 | * @return array |
|