class FormBaseAlterEvent in Hook Event Dispatcher 8.2
Same name and namespace in other branches
- 3.x modules/core_event_dispatcher/src/Event/Form/FormBaseAlterEvent.php \Drupal\core_event_dispatcher\Event\Form\FormBaseAlterEvent
Class FormBaserAlterEvent.
Hierarchy
- class \Drupal\core_event_dispatcher\Event\Form\AbstractFormEvent extends \Symfony\Component\EventDispatcher\Event implements EventInterface
- class \Drupal\core_event_dispatcher\Event\Form\FormBaseAlterEvent
Expanded class hierarchy of FormBaseAlterEvent
2 files declare their use of FormBaseAlterEvent
- core_event_dispatcher.module in modules/
core_event_dispatcher/ core_event_dispatcher.module - Core event dispatcher submodule.
- ExampleFormEventSubscribers.php in examples/
ExampleFormEventSubscribers.php
File
- modules/
core_event_dispatcher/ src/ Event/ Form/ FormBaseAlterEvent.php, line 10
Namespace
Drupal\core_event_dispatcher\Event\FormView source
class FormBaseAlterEvent extends AbstractFormEvent {
/**
* The base form id.
*
* @var string
*/
private $baseFormId;
/**
* FormBaseAlterEvent constructor.
*
* @param array $form
* Nested array of form elements that comprise the form.
* @param \Drupal\Core\Form\FormStateInterface $formState
* The current state of the form. The arguments that
* \Drupal::formBuilder()->getForm() was originally called with are
* available in the array $form_state->getBuildInfo()['args'].
* @param string $formId
* String representing the name of the form itself. Typically this is the
* name of the function that generated the form.
* @param string $baseFormId
* The base form id.
*/
public function __construct(array &$form, FormStateInterface $formState, string $formId, string $baseFormId) {
parent::__construct($form, $formState, $formId);
$this->baseFormId = $baseFormId;
}
/**
* {@inheritdoc}
*/
public function getDispatcherType() : string {
return 'hook_event_dispatcher.form_base_' . $this
->getBaseFormId() . '.alter';
}
/**
* Get the base form id.
*
* @return string
* The base form id.
*/
public function getBaseFormId() : string {
return $this->baseFormId;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AbstractFormEvent:: |
private | property | The form. | |
AbstractFormEvent:: |
private | property | The form id. | |
AbstractFormEvent:: |
private | property | The form state. | |
AbstractFormEvent:: |
public | function | Get the form. | |
AbstractFormEvent:: |
public | function | Get the form id. | |
AbstractFormEvent:: |
public | function | Get the form state. | |
FormBaseAlterEvent:: |
private | property | The base form id. | |
FormBaseAlterEvent:: |
public | function | Get the base form id. | |
FormBaseAlterEvent:: |
public | function |
Get the dispatcher type. Overrides EventInterface:: |
|
FormBaseAlterEvent:: |
public | function |
FormBaseAlterEvent constructor. Overrides AbstractFormEvent:: |