You are here

class MediaSourceInfoAlterEvent in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x modules/media_event_dispatcher/src/Event/Media/MediaSourceInfoAlterEvent.php \Drupal\media_event_dispatcher\Event\Media\MediaSourceInfoAlterEvent

Class MediaSourceInfoAlterEvent.

Hierarchy

Expanded class hierarchy of MediaSourceInfoAlterEvent

2 files declare their use of MediaSourceInfoAlterEvent
MediaSourceInfoAlterEventTest.php in modules/media_event_dispatcher/tests/src/Unit/Media/MediaSourceInfoAlterEventTest.php
media_event_dispatcher.module in modules/media_event_dispatcher/media_event_dispatcher.module
Media event dispatcher submodule.

File

modules/media_event_dispatcher/src/Event/Media/MediaSourceInfoAlterEvent.php, line 12

Namespace

Drupal\media_event_dispatcher\Event\Media
View source
class MediaSourceInfoAlterEvent extends Event implements EventInterface {

  /**
   * The array of media source plugin definitions, keyed by plugin ID.
   *
   * @var array
   */
  private $sources;

  /**
   * MediaSourceInfoAlterEvent constructor.
   *
   * @param array &$sources
   *   The array of media source plugin definitions, keyed by plugin ID.
   */
  public function __construct(array &$sources) {
    $this->sources =& $sources;
  }

  /**
   * Get the media source plugin definitions.
   *
   * @return array
   *   The array of media source plugin definitions, keyed by plugin ID.
   */
  public function &getSources() : array {
    return $this->sources;
  }

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

}

Members

Namesort descending Modifiers Type Description Overrides
MediaSourceInfoAlterEvent::$sources private property The array of media source plugin definitions, keyed by plugin ID.
MediaSourceInfoAlterEvent::getDispatcherType public function Get the dispatcher type. Overrides EventInterface::getDispatcherType
MediaSourceInfoAlterEvent::getSources public function Get the media source plugin definitions.
MediaSourceInfoAlterEvent::__construct public function MediaSourceInfoAlterEvent constructor.