You are here

final class AutosaveEntityFormHandler in Lightning Workflow 8.3

Disables autosave in the Layout Builder interface.

@internal This class is a temporary workaround to a limitation of autosave_form and is subject to change or removal at any time without warning. It should NOT be used in any way by external code!

Hierarchy

Expanded class hierarchy of AutosaveEntityFormHandler

File

src/AutosaveEntityFormHandler.php, line 17

Namespace

Drupal\lightning_workflow
View source
final class AutosaveEntityFormHandler extends BaseAutosaveEntityFormHandler {

  /**
   * {@inheritdoc}
   */
  public function formAlter(array &$form, FormStateInterface $form_state) {
    $form_object = $form_state
      ->getFormObject();
    if ($form_object instanceof EntityFormInterface && $form_object
      ->getOperation() === 'layout_builder') {
      return;
    }
    else {
      parent::formAlter($form, $form_state);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AutosaveButtonClickedTrait::isAutosaveTriggered protected function Checks if the submission is triggered by autosave save.
AutosaveButtonClickedTrait::isRejectTriggered protected function Checks if autosave restore has been triggered.
AutosaveButtonClickedTrait::isRestoreTriggered protected function Checks if autosave restore has been triggered.
AutosaveEntityFormHandler::$autosaveEntityFormStorage protected property The autosave form storage.
AutosaveEntityFormHandler::$configFactory protected property The configuration factory.
AutosaveEntityFormHandler::$conflictEnabled protected property Defines whether the conflict module is enabled or not.
AutosaveEntityFormHandler::$currentUser protected property The current user.
AutosaveEntityFormHandler::$dateFormatter protected property The date formatter service.
AutosaveEntityFormHandler::$entityStorage protected property The entity storage.
AutosaveEntityFormHandler::$entityType protected property Information about the entity type.
AutosaveEntityFormHandler::$entityTypeId protected property The type of the entity for whose form the autosave form is used.
AutosaveEntityFormHandler::$keyValueExpirableFactory protected property The factory for expirable key value stores used by form cache.
AutosaveEntityFormHandler::$time protected property The time service.
AutosaveEntityFormHandler::autosaveFormAjax public function Ajax callback for autosaving content entity forms.
AutosaveEntityFormHandler::createInstance public static function Instantiates a new instance of this entity handler. Overrides EntityHandlerInterface::createInstance
AutosaveEntityFormHandler::entityFormEntityBuild public static function Entity builder method.
AutosaveEntityFormHandler::formAlter public function Performs the needed alterations to the entity form. Overrides AutosaveEntityFormHandler::formAlter
AutosaveEntityFormHandler::getAutosaveSessionID public static function Returns the autosave session ID of the entity. Overrides AutosaveEntityFormHandlerInterface::getAutosaveSessionID
AutosaveEntityFormHandler::getFormIDandEntity protected function Retrieves the form ID and the form entity object from the form state.
AutosaveEntityFormHandler::getLastAutosavedFormState public function Retrieves the last autosaved form state if any present. Overrides AutosaveFormInterface::getLastAutosavedFormState
AutosaveEntityFormHandler::getLastAutosavedTimestamp public function Retrieves the last autosaved timestamp. Overrides AutosaveFormInterface::getLastAutosavedTimestamp
AutosaveEntityFormHandler::isAutosaveEnabled public function Determines if autosave is enabled for the current form. Overrides AutosaveFormInterface::isAutosaveEnabled
AutosaveEntityFormHandler::isAutosaveSubmitValid public function Checks if the autosave submit is allowed. Overrides AutosaveFormInterface::isAutosaveSubmitValid
AutosaveEntityFormHandler::purgeAllAutosavedStates public function Purges all autosaved state sessions for the current form and user. Overrides AutosaveFormInterface::purgeAllAutosavedStates
AutosaveEntityFormHandler::purgeCurrentAutosavedState public function Purges the current autosave state session for the form state and user. Overrides AutosaveFormInterface::purgeCurrentAutosavedState
AutosaveEntityFormHandler::storeState public function Stores the state of the form in the autosave storage. Overrides AutosaveFormInterface::storeState
AutosaveEntityFormHandler::__construct public function Initializes an instance of the autosave form controller.
AutosaveEntityFormHandlerInterface::AUTOSAVE_SESSION_ID constant The object property to use to flag the entity with the autosave session ID.
AutosaveFormAlterTrait::autosaveFormAjax public function Ajax callback for autosaving forms. Aliased as: traitAutosaveFormAjax
AutosaveFormAlterTrait::autosaveFormRejectAjax public function Ajax callback for rejecting autosaved states.
AutosaveFormAlterTrait::autosaveFormRejectSubmit public function Form submission handler for rejecting autosaved states.
AutosaveFormAlterTrait::autosaveFormRestoreSubmit public function Form submission handler for restoring autosaved state.
AutosaveFormAlterTrait::autosaveFormSubmit public function Form submission handler for autosaving forms.
AutosaveFormAlterTrait::formAlter public function Performs the needed alterations to the form. Aliased as: traitFormAlter
AutosaveFormAlterTrait::getAutosaveFormSessionID protected static function Retrieves the autosave form session ID.
AutosaveFormAlterTrait::getRequestMethod protected function Returns the HTTP method used by the request that is building the form.
AutosaveFormAlterTrait::setAutosaveFormSessionID protected function Sets the autosave form session ID into the form state.
AutosaveFormInterface::AUTOSAVE_ELEMENT_NAME constant
AutosaveFormInterface::AUTOSAVE_REJECT_ELEMENT_NAME constant
AutosaveFormInterface::AUTOSAVE_RESTORE_ELEMENT_NAME constant
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.