You are here

protected function Hidden::defineDefaultProperties in Webform 8.5

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

Define an element's default properties.

Return value

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

Overrides TextBase::defineDefaultProperties

File

src/Plugin/WebformElement/Hidden.php, line 25

Class

Hidden
Provides a 'hidden' element.

Namespace

Drupal\webform\Plugin\WebformElement

Code

protected function defineDefaultProperties() {

  // Include only the access-view-related base properties.
  $access_properties = $this
    ->defineDefaultBaseProperties();
  $access_properties = array_filter($access_properties, function ($access_default, $access_key) {
    return strpos($access_key, 'access_') === 0;
  }, ARRAY_FILTER_USE_BOTH);
  return [
    // Element settings.
    'title' => '',
    'default_value' => '',
    // Administration.
    'prepopulate' => FALSE,
    'private' => FALSE,
  ] + $access_properties;
}