You are here

public function AutosaveEntityFormHandler::storeState in Autosave Form 8

Stores the state of the form in the autosave storage.

Parameters

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

string $autosave_form_session_id: The autosave form session ID.

int $autosave_timestamp: The timestamp to use for the autosave record.

string|int $uid: The user id.

Overrides AutosaveFormInterface::storeState

File

src/Form/AutosaveEntityFormHandler.php, line 262

Class

AutosaveEntityFormHandler
Base class for autosave form handlers.

Namespace

Drupal\autosave_form\Form

Code

public function storeState(FormStateInterface $form_state, $autosave_form_session_id, $autosave_timestamp, $uid) {
  list($form_id, $entity) = $this
    ->getFormIDandEntity($form_state);
  $this->autosaveEntityFormStorage
    ->storeEntityAndFormState($form_id, $autosave_form_session_id, $entity
    ->getEntityTypeId(), $entity
    ->id(), $entity
    ->language()
    ->getId(), $uid, $autosave_timestamp, $entity, $form_state);
}