You are here

public function AutosaveEntityFormHandler::purgeCurrentAutosavedState in Autosave Form 8

Purges the current autosave state session for the form state and user.

Parameters

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

string|int $uid: The user id for which to purge the autosaved states.

Overrides AutosaveFormInterface::purgeCurrentAutosavedState

File

src/Form/AutosaveEntityFormHandler.php, line 278

Class

AutosaveEntityFormHandler
Base class for autosave form handlers.

Namespace

Drupal\autosave_form\Form

Code

public function purgeCurrentAutosavedState(FormStateInterface $form_state, $uid) {
  list($form_id, $entity) = $this
    ->getFormIDandEntity($form_state);
  $this->autosaveEntityFormStorage
    ->purgeAutosavedEntityState($entity
    ->getEntityTypeId(), $entity
    ->id(), $this
    ->getAutosaveFormSessionID($form_state), $form_id, $entity
    ->language()
    ->getId(), $uid);
}