You are here

protected function WebformAutocomplete::defineDefaultProperties in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Plugin/WebformElement/WebformAutocomplete.php \Drupal\webform\Plugin\WebformElement\WebformAutocomplete::defineDefaultProperties()

Define an element's default properties.

Return value

array An associative array contain an the element's default properties.

Overrides TextField::defineDefaultProperties

File

src/Plugin/WebformElement/WebformAutocomplete.php, line 23

Class

WebformAutocomplete
Provides a 'autocomplete' element.

Namespace

Drupal\webform\Plugin\WebformElement

Code

protected function defineDefaultProperties() {
  $properties = [
    // Autocomplete settings.
    'autocomplete_existing' => FALSE,
    'autocomplete_items' => [],
    'autocomplete_limit' => 10,
    'autocomplete_match' => 3,
    'autocomplete_match_operator' => 'CONTAINS',
  ] + parent::defineDefaultProperties() + $this
    ->defineDefaultMultipleProperties();

  // Remove autocomplete property which is not applicable to
  // this autocomplete element.
  unset($properties['autocomplete']);
  return $properties;
}