You are here

public function FlexiformBuilderFlexiform::formValidate in Flexiform 7

Validate the input for the form.

Overrides FlexiformBuilder::formValidate

File

includes/builder/flexiform.builder.inc, line 157
Contains the FlexiformBuilderFlexiform Class

Class

FlexiformBuilderFlexiform
Flexiform Builder Class for the complex flexiforms.

Code

public function formValidate($form, &$form_state) {

  // Get the flexiform state for this particular form.
  $flexiform_state =& $this
    ->getFlexiformState($form, $form_state);
  foreach (element_children($form) as $element_namespace) {
    if (empty($form[$element_namespace]['#flexiform_element'])) {
      continue;
    }
    $element = $form[$element_namespace]['#flexiform_element'];
    $entity = $this
      ->getFormEntity($element
      ->getEntityNamespace(), $flexiform_state);
    $element
      ->formValidate($form, $form_state, $entity);
  }
  $this
    ->invoke($form, $form_state, 'validate');
}