You are here

protected function FormBuilderFormBase::indexElements in Form Builder 7

Add the element and it's subelements to the elementd index.

The index is stored in $this->elementArrays and used by all element_id based methods.

3 calls to FormBuilderFormBase::indexElements()
FormBuilderFormBase::setElementArray in ./form_builder.classes.inc
(@inheritdoc}
FormBuilderFormBase::unserialize in ./form_builder.classes.inc
Unserialize a stored version of this form.
FormBuilderFormBase::__construct in ./form_builder.classes.inc

File

./form_builder.classes.inc, line 516

Class

FormBuilderFormBase

Code

protected function indexElements(&$element) {
  if (isset($element['#form_builder']['element_id'])) {
    $element_id = $element['#form_builder']['element_id'];
    $this->elementArrays[$element_id] =& $element;
  }
  foreach (element_children($element) as $key) {
    $this
      ->indexElements($element[$key]);
  }
}