public static function InlineEntityFormComplex::submitCloseRow in Inline Entity Form 8
Button #submit callback: Closes a row 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_row_form()
File
- src/
Plugin/ Field/ FieldWidget/ InlineEntityFormComplex.php, line 852
Class
- InlineEntityFormComplex
- Complex inline widget.
Namespace
Drupal\inline_entity_form\Plugin\Field\FieldWidgetCode
public static function submitCloseRow($form, FormStateInterface $form_state) {
$element = inline_entity_form_get_element($form, $form_state);
$ief_id = $element['#ief_id'];
$delta = $form_state
->getTriggeringElement()['#ief_row_delta'];
$form_state
->setRebuild();
$form_state
->set([
'inline_entity_form',
$ief_id,
'entities',
$delta,
'form',
], NULL);
}