You are here

public function WebformCustomComposite::initializeCompositeElements in Webform 8.5

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

Initialize and cache #webform_composite_elements.

Parameters

array $element: A composite element.

Overrides WebformCompositeBase::initializeCompositeElements

File

src/Plugin/WebformElement/WebformCustomComposite.php, line 197

Class

WebformCustomComposite
Provides a custom composite element.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function initializeCompositeElements(array &$element) {
  $element['#webform_composite_elements'] = [];
  foreach ($element['#element'] as $composite_key => $composite_element) {
    $this->elementManager
      ->initializeElement($composite_element);
    $element['#webform_composite_elements'][$composite_key] = $composite_element;
  }
  $this
    ->initializeCompositeElementsRecursive($element, $element['#webform_composite_elements']);
}