You are here

class EntityLoadEvent in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 modules/core_event_dispatcher/src/Event/Entity/EntityLoadEvent.php \Drupal\core_event_dispatcher\Event\Entity\EntityLoadEvent

Class EntityLoadEvent.

Hierarchy

Expanded class hierarchy of EntityLoadEvent

1 file declares its use of EntityLoadEvent
core_event_dispatcher.module in modules/core_event_dispatcher/core_event_dispatcher.module
Core event dispatcher submodule.

File

modules/core_event_dispatcher/src/Event/Entity/EntityLoadEvent.php, line 12

Namespace

Drupal\core_event_dispatcher\Event\Entity
View source
class EntityLoadEvent extends Event implements EventInterface {

  /**
   * The entities.
   *
   * @var array
   */
  private $entities;

  /**
   * The entity type id.
   *
   * @var string
   */
  private $entityTypeId;

  /**
   * EntityLoadEvent constructor.
   *
   * @param array $entities
   *   The entities.
   * @param string $entityTypeId
   *   The entity type id.
   */
  public function __construct(array $entities, $entityTypeId) {
    $this->entities = $entities;
    $this->entityTypeId = $entityTypeId;
  }

  /**
   * Get the entities.
   *
   * @return array
   *   The entities.
   */
  public function getEntities() : array {
    return $this->entities;
  }

  /**
   * Get the entity type id.
   *
   * @return string
   *   The entity type id.
   */
  public function getEntityTypeId() : string {
    return $this->entityTypeId;
  }

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

}

Members

Namesort descending Modifiers Type Description Overrides
EntityLoadEvent::$entities private property The entities.
EntityLoadEvent::$entityTypeId private property The entity type id.
EntityLoadEvent::getDispatcherType public function Get the dispatcher type. Overrides EventInterface::getDispatcherType
EntityLoadEvent::getEntities public function Get the entities.
EntityLoadEvent::getEntityTypeId public function Get the entity type id.
EntityLoadEvent::__construct public function EntityLoadEvent constructor.