You are here

abstract class BaseEntityEvent in Hook Event Dispatcher 8

Class BaseEntityEvent.

Hierarchy

Expanded class hierarchy of BaseEntityEvent

File

src/Event/Entity/BaseEntityEvent.php, line 12

Namespace

Drupal\hook_event_dispatcher\Event\Entity
View source
abstract class BaseEntityEvent extends Event implements EventInterface {

  /**
   * The Entity.
   *
   * @var \Drupal\Core\Entity\EntityInterface
   */
  protected $entity;

  /**
   * BaseEntityEvent constructor.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The Entity.
   */
  public function __construct(EntityInterface $entity) {
    $this->entity = $entity;
  }

  /**
   * Get the Entity.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   The Entity.
   */
  public function getEntity() {
    return $this->entity;
  }

  /**
   * Set the Entity.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The Entity.
   *
   * @deprecated This is not needed, objects are past by reference.
   */
  public function setEntity(EntityInterface $entity) {
    $this->entity = $entity;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BaseEntityEvent::$entity protected property The Entity.
BaseEntityEvent::getEntity public function Get the Entity.
BaseEntityEvent::setEntity Deprecated public function Set the Entity.
BaseEntityEvent::__construct public function BaseEntityEvent constructor. 4
EventInterface::getDispatcherType public function Get the dispatcher type. 66