You are here

public function WebformUsers::getInfo in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Element/WebformUsers.php \Drupal\webform\Element\WebformUsers::getInfo()

Returns the element properties for this element.

Return value

array An array of element properties. See \Drupal\Core\Render\ElementInfoManagerInterface::getInfo() for documentation of the standard properties of all elements, and the return value format.

Overrides EntityAutocomplete::getInfo

File

src/Element/WebformUsers.php, line 20

Class

WebformUsers
Provides a users entity reference webform element.

Namespace

Drupal\webform\Element

Code

public function getInfo() {
  $info = parent::getInfo();
  $class = get_class($this);
  $info['#target_type'] = 'user';
  $info['#selection_settings'] = [
    'include_anonymous' => FALSE,
  ];
  $info['#tags'] = TRUE;
  $info['#maxlength'] = NULL;
  $info['#default_value'] = [];
  $info['#element_validate'] = [
    [
      $class,
      'validateEntityAutocomplete',
    ],
    [
      $class,
      'validateWebformUsers',
    ],
  ];
  return $info;
}