public function AutosaveEntityFormHandler::isAutosaveEnabled in Autosave Form 8
Determines if autosave is enabled for the current form.
Parameters
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
bool TRUE if autosave is enabled, FALSE otherwise.
Overrides AutosaveFormInterface::isAutosaveEnabled
File
- src/
Form/ AutosaveEntityFormHandler.php, line 294
Class
- AutosaveEntityFormHandler
- Base class for autosave form handlers.
Namespace
Drupal\autosave_form\FormCode
public function isAutosaveEnabled(FormStateInterface $form_state) {
list($form_id, $entity) = $this
->getFormIDandEntity($form_state);
$allowed = !$entity
->isNew() && !$this->currentUser
->isAnonymous();
return $allowed;
}