class AutosaveFormErrorHandler in Autosave Form 8
Handles form errors.
Hierarchy
- class \Drupal\Core\Form\FormErrorHandler implements FormErrorHandlerInterface uses MessengerTrait
- class \Drupal\autosave_form\Form\AutosaveFormErrorHandler uses AutosaveButtonClickedTrait
Expanded class hierarchy of AutosaveFormErrorHandler
1 string reference to 'AutosaveFormErrorHandler'
1 service uses AutosaveFormErrorHandler
File
- src/
Form/ AutosaveFormErrorHandler.php, line 12
Namespace
Drupal\autosave_form\FormView source
class AutosaveFormErrorHandler extends FormErrorHandler {
use AutosaveButtonClickedTrait;
/**
* The form error handler.
*
* @var \Drupal\Core\Form\FormErrorHandlerInterface
*/
protected $formErrorHandler;
/**
* Constructs a AutosaveFormErrorHandler object.
*
* @param \Drupal\Core\Form\FormErrorHandlerInterface $form_error_handler
* The form error handler service.
*/
public function __construct(FormErrorHandlerInterface $form_error_handler) {
$this->formErrorHandler = $form_error_handler;
}
/**
* {@inheritdoc}
*/
public function handleFormErrors(array &$form, FormStateInterface $form_state) {
if ($this
->isAutosaveTriggered($form_state)) {
return $this;
}
return $this->formErrorHandler
->handleFormErrors($form, $form_state);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AutosaveButtonClickedTrait:: |
protected | function | Checks if the submission is triggered by autosave save. | |
AutosaveButtonClickedTrait:: |
protected | function | Checks if autosave restore has been triggered. | |
AutosaveButtonClickedTrait:: |
protected | function | Checks if autosave restore has been triggered. | |
AutosaveFormErrorHandler:: |
protected | property | The form error handler. | |
AutosaveFormErrorHandler:: |
public | function |
Handles form errors after form validation. Overrides FormErrorHandler:: |
|
AutosaveFormErrorHandler:: |
public | function | Constructs a AutosaveFormErrorHandler object. | |
FormErrorHandler:: |
protected | function | Loops through and displays all form errors. | 1 |
FormErrorHandler:: |
protected | function | Stores errors and a list of child element errors directly on each element. | |
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. |