You are here

public function WebformCompositeBase::getConfigurationFormProperties in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/WebformCompositeBase.php \Drupal\webform\Plugin\WebformElement\WebformCompositeBase::getConfigurationFormProperties()

Get an associative array of element properties from configuration webform.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array An associative array of element properties.

Overrides WebformElementBase::getConfigurationFormProperties

File

src/Plugin/WebformElement/WebformCompositeBase.php, line 1251

Class

WebformCompositeBase
Provides a base for composite elements.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function getConfigurationFormProperties(array &$form, FormStateInterface $form_state) {
  $properties = parent::getConfigurationFormProperties($form, $form_state);
  foreach ($properties as $key => $value) {

    // Convert composite element access and required to boolean value.
    if (preg_match('/__(access|required)$/', $key)) {
      $properties[$key] = (bool) $value;
    }
  }
  return $properties;
}