You are here

protected static function AutosaveFormAlterTrait::getAutosaveFormSessionID in Autosave Form 8

Retrieves the autosave form session ID.

Parameters

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

Return value

string|NULL The autosave form session ID or NULL if none present yet.

4 calls to AutosaveFormAlterTrait::getAutosaveFormSessionID()
AutosaveEntityFormHandler::entityFormEntityBuild in src/Form/AutosaveEntityFormHandler.php
Entity builder method.
AutosaveEntityFormHandler::purgeCurrentAutosavedState in src/Form/AutosaveEntityFormHandler.php
Purges the current autosave state session for the form state and user.
AutosaveFormAlterTrait::autosaveFormSubmit in src/Form/AutosaveFormAlterTrait.php
Form submission handler for autosaving forms.
AutosaveFormAlterTrait::formAlter in src/Form/AutosaveFormAlterTrait.php
Performs the needed alterations to the form.

File

src/Form/AutosaveFormAlterTrait.php, line 256

Class

AutosaveFormAlterTrait
Provides a trait for common autosave form alterations.

Namespace

Drupal\autosave_form\Form

Code

protected static function getAutosaveFormSessionID(FormStateInterface $form_state) {
  return $form_state
    ->get('autosave_form_session_id');
}