You are here

public static function WizardEditForm::parameterEntityTypeBundleElementValidate in Flexiform 8

Element validation handler for the parameter entity type bundle.

Parameters

array $element: The element array.

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

array $form: The complete form array.

File

contrib/wizard/src/Form/WizardEditForm.php, line 118

Class

WizardEditForm
Provides an edit form for flexiform wizard entities.

Namespace

Drupal\flexiform_wizard\Form

Code

public static function parameterEntityTypeBundleElementValidate(array $element, FormStateInterface $form_state, array $form = []) {
  $parents = $element['#parents'];
  $entity_type_bundle = $form_state
    ->getValue($parents);
  array_pop($parents);
  $parameter_info = $form_state
    ->getValue($parents);
  unset($parameter_info['entity_type_bundle']);
  list($parameter_info['entity_type'], $parameter_info['bundle']) = explode(':', $entity_type_bundle, 2);
  $form_state
    ->setValue($parents, $parameter_info);
}