You are here

protected function Webform::collectSubElementKeysRecursive in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Entity/Webform.php \Drupal\webform\Entity\Webform::collectSubElementKeysRecursive()

Collect sub element keys from a render array.

Parameters

array $sub_element_keys: An array to be populated with sub element keys.

array $elements: A render array.

1 call to Webform::collectSubElementKeysRecursive()
Webform::deleteElementRecursive in src/Entity/Webform.php
Remove an element by key from a render array.

File

src/Entity/Webform.php, line 1997

Class

Webform
Defines the webform entity.

Namespace

Drupal\webform\Entity

Code

protected function collectSubElementKeysRecursive(array &$sub_element_keys, array $elements) {
  foreach ($elements as $key => &$element) {
    if (!WebformElementHelper::isElement($element, $key)) {
      continue;
    }
    $sub_element_keys[$key] = $key;
    $this
      ->collectSubElementKeysRecursive($sub_element_keys, $element);
  }
}