You are here

public function EntityFormField::viewsFormProcess in Views Entity Form Field 8

Processes the form, adding the submission handler to save the entities.

Parameters

array $element: A nested array form elements comprising the form.

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

Return value

array The processed form element.

File

src/Plugin/views/field/EntityFormField.php, line 531

Class

EntityFormField
Defines a views form element for an entity field widget.

Namespace

Drupal\views_entity_form_field\Plugin\views\field

Code

public function viewsFormProcess(array $element, FormStateInterface $form_state) {
  $element['#submit'][] = [
    $this,
    'saveEntities',
  ];
  return $element;
}