You are here

public function AutosaveEntityFormHandler::purgeAllAutosavedStates in Autosave Form 8

Purges all autosaved state sessions for the current form 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::purgeAllAutosavedStates

File

src/Form/AutosaveEntityFormHandler.php, line 286

Class

AutosaveEntityFormHandler
Base class for autosave form handlers.

Namespace

Drupal\autosave_form\Form

Code

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