You are here

public static function InlineEntityFormComplex::closeForm in Inline Entity Form 8

Button #submit callback: Closes a form in the IEF widget.

Parameters

$form: The complete parent form.

$form_state: The form state of the parent form.

See also

inline_entity_form_open_form()

File

src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php, line 966

Class

InlineEntityFormComplex
Complex inline widget.

Namespace

Drupal\inline_entity_form\Plugin\Field\FieldWidget

Code

public static function closeForm($form, FormStateInterface $form_state) {
  $element = inline_entity_form_get_element($form, $form_state);
  $ief_id = $element['#ief_id'];
  $form_state
    ->setRebuild();
  $form_state
    ->set([
    'inline_entity_form',
    $ief_id,
    'form',
  ], NULL);
}