You are here

protected function Telephone::defineDefaultProperties in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/Telephone.php \Drupal\webform\Plugin\WebformElement\Telephone::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/Telephone.php, line 54

Class

Telephone
Provides a 'tel' element.

Namespace

Drupal\webform\Plugin\WebformElement

Code

protected function defineDefaultProperties() {
  $properties = [
    'input_hide' => FALSE,
    'multiple' => FALSE,
    'international' => FALSE,
    'international_initial_country' => '',
    'international_preferred_countries' => [],
  ] + parent::defineDefaultProperties() + $this
    ->defineDefaultMultipleProperties();

  // Add support for telephone_validation.module.
  if ($this->moduleHandler
    ->moduleExists('telephone_validation')) {
    $properties += [
      'telephone_validation_format' => '',
      'telephone_validation_country' => '',
      'telephone_validation_countries' => [],
    ];
  }
  return $properties;
}