You are here

abstract class AbstractFieldSettingsSummaryFormEvent in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 modules/field_event_dispatcher/src/Event/Field/AbstractFieldSettingsSummaryFormEvent.php \Drupal\field_event_dispatcher\Event\Field\AbstractFieldSettingsSummaryFormEvent

Class AbstractFieldSettingsSummaryFormEvent.

Hierarchy

Expanded class hierarchy of AbstractFieldSettingsSummaryFormEvent

1 file declares its use of AbstractFieldSettingsSummaryFormEvent
AbstractFieldSettingsSummaryAlterEventTestCase.php in modules/field_event_dispatcher/tests/src/Unit/Field/AbstractFieldSettingsSummaryAlterEventTestCase.php

File

modules/field_event_dispatcher/src/Event/Field/AbstractFieldSettingsSummaryFormEvent.php, line 11

Namespace

Drupal\field_event_dispatcher\Event\Field
View source
abstract class AbstractFieldSettingsSummaryFormEvent extends Event implements EventInterface {

  /**
   * An array of summary messages.
   *
   * @var array
   */
  private $summary;

  /**
   * An associative array containing related context for this formatter/widget.
   *
   * @var array
   */
  private $context;

  /**
   * AbstractFieldSettingsSummaryFormEvent constructor.
   *
   * @param array &$summary
   *   An array of summary messages.
   * @param array $context
   *   An associative array with the following elements:
   *   - field_definition: The field definition.
   *   If this is a field formatter, will also contain:
   *   - formatter: The formatter plugin.
   *   - view_mode: The view mode being configured.
   *   If this is a field widget, will also contain:
   *   - widget: The widget object.
   *   - form_mode: The form mode being configured.
   */
  public function __construct(array &$summary, array $context) {
    $this->summary =& $summary;
    $this->context = $context;
  }

  /**
   * Get the existing array of summary messages.
   *
   * @return array
   *   An array of summary messages.
   */
  public function &getSummary() : array {
    return $this->summary;
  }

  /**
   * Get the associative array containing context for this formatter/widget.
   *
   * @return array
   *   An associative array of context for this field formatter/widget instance.
   */
  public function getContext() : array {
    return $this->context;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AbstractFieldSettingsSummaryFormEvent::$context private property An associative array containing related context for this formatter/widget.
AbstractFieldSettingsSummaryFormEvent::$summary private property An array of summary messages.
AbstractFieldSettingsSummaryFormEvent::getContext public function Get the associative array containing context for this formatter/widget.
AbstractFieldSettingsSummaryFormEvent::getSummary public function Get the existing array of summary messages.
AbstractFieldSettingsSummaryFormEvent::__construct public function AbstractFieldSettingsSummaryFormEvent constructor.
EventInterface::getDispatcherType public function Get the dispatcher type. 75