You are here

class FieldWidgetThirdPartySettingsFormEvent in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x modules/field_event_dispatcher/src/Event/Field/FieldWidgetThirdPartySettingsFormEvent.php \Drupal\field_event_dispatcher\Event\Field\FieldWidgetThirdPartySettingsFormEvent

Class FieldWidgetThirdPartySettingsFormEvent.

Hierarchy

Expanded class hierarchy of FieldWidgetThirdPartySettingsFormEvent

2 files declare their use of FieldWidgetThirdPartySettingsFormEvent
FieldWidgetThirdPartySettingsFormEventTest.php in modules/field_event_dispatcher/tests/src/Unit/Field/FieldWidgetThirdPartySettingsFormEventTest.php
field_event_dispatcher.module in modules/field_event_dispatcher/field_event_dispatcher.module
Field event dispatcher submodule.

File

modules/field_event_dispatcher/src/Event/Field/FieldWidgetThirdPartySettingsFormEvent.php, line 13

Namespace

Drupal\field_event_dispatcher\Event\Field
View source
class FieldWidgetThirdPartySettingsFormEvent extends AbstractFieldThirdPartySettingsFormEvent {

  /**
   * The instantiated field widget plugin.
   *
   * @var \Drupal\Core\Field\WidgetInterface
   */
  private $plugin;

  /**
   * The entity form mode.
   *
   * @var string
   */
  private $formMode;

  /**
   * FieldWidgetThirdPartySettingsFormEvent constructor.
   *
   * @param \Drupal\Core\Field\WidgetInterface $plugin
   *   The instantiated field widget plugin.
   * @param \Drupal\Core\Field\FieldDefinitionInterface $fieldDefinition
   *   The field definition.
   * @param string $formMode
   *   The entity form mode.
   * @param array $form
   *   The (entire) configuration form array.
   * @param \Drupal\Core\Form\FormStateInterface $formState
   *   The form state.
   */
  public function __construct(WidgetInterface $plugin, FieldDefinitionInterface $fieldDefinition, string $formMode, array $form, FormStateInterface $formState) {
    $this->plugin = $plugin;
    $this->fieldDefinition = $fieldDefinition;
    $this->formMode = $formMode;
    $this->form = $form;
    $this->formState = $formState;
  }

  /**
   * Get the instantiated field widget plugin.
   *
   * @return \Drupal\Core\Field\WidgetInterface
   *   A field widget plugin.
   */
  public function getPlugin() : WidgetInterface {
    return $this->plugin;
  }

  /**
   * Get the entity form mode.
   *
   * @return string
   *   The form mode.
   */
  public function getFormMode() : string {
    return $this->formMode;
  }

  /**
   * {@inheritdoc}
   */
  public function getDispatcherType() : string {
    return HookEventDispatcherInterface::FIELD_WIDGET_THIRD_PARTY_SETTINGS_FORM;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AbstractFieldThirdPartySettingsFormEvent::$elements protected property Third-party form elements to be added to the form.
AbstractFieldThirdPartySettingsFormEvent::$fieldDefinition protected property The field definition.
AbstractFieldThirdPartySettingsFormEvent::$form protected property The (entire) configuration form array.
AbstractFieldThirdPartySettingsFormEvent::$formState protected property The form state.
AbstractFieldThirdPartySettingsFormEvent::addElements public function Add third-party form elements to the form.
AbstractFieldThirdPartySettingsFormEvent::getElements public function Get the third-party form elements to be added to the form.
AbstractFieldThirdPartySettingsFormEvent::getFieldDefinition Deprecated public function Get the field definition.
AbstractFieldThirdPartySettingsFormEvent::getFieldDefintion public function Get the field definition.
AbstractFieldThirdPartySettingsFormEvent::getForm public function Get the (entire) configuration form array.
AbstractFieldThirdPartySettingsFormEvent::getFormState public function Get the form state.
FieldWidgetThirdPartySettingsFormEvent::$formMode private property The entity form mode.
FieldWidgetThirdPartySettingsFormEvent::$plugin private property The instantiated field widget plugin.
FieldWidgetThirdPartySettingsFormEvent::getDispatcherType public function Get the dispatcher type. Overrides EventInterface::getDispatcherType
FieldWidgetThirdPartySettingsFormEvent::getFormMode public function Get the entity form mode.
FieldWidgetThirdPartySettingsFormEvent::getPlugin public function Get the instantiated field widget plugin.
FieldWidgetThirdPartySettingsFormEvent::__construct public function FieldWidgetThirdPartySettingsFormEvent constructor.