You are here

public function AutocompleteDeluxeElement::getInfo in Autocomplete Deluxe 2.0.x

Same name and namespace in other branches
  1. 8 src/Element/AutocompleteDeluxeElement.php \Drupal\autocomplete_deluxe\Element\AutocompleteDeluxeElement::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 ElementInterface::getInfo

File

src/Element/AutocompleteDeluxeElement.php, line 22

Class

AutocompleteDeluxeElement
Provides an Autocomplete Deluxe Form API element.

Namespace

Drupal\autocomplete_deluxe\Element

Code

public function getInfo() {
  $class = get_class($this);

  // Apply default form element properties.
  $info['#target_type'] = NULL;
  $info['#selection_handler'] = 'default';
  $info['#selection_settings'] = [];
  $info['#tags'] = TRUE;
  $info['#autocreate'] = NULL;

  // This should only be set to FALSE if proper validation by the selection
  // handler is performed at another level on the extracted form values.
  $info['#validate_reference'] = TRUE;

  // IMPORTANT! This should only be set to FALSE if the #default_value
  // property is processed at another level (e.g. by a Field API widget) and
  // its value is properly checked for access.
  $info['#process_default_value'] = TRUE;
  $info['#element_validate'] = [
    [
      '\\Drupal\\Core\\Entity\\Element\\EntityAutocomplete',
      'validateEntityAutocomplete',
    ],
  ];
  $info['#process'][] = [
    $class,
    'processElement',
  ];
  return $info;
}