You are here

class EntityPresaveEvent in Hook Event Dispatcher 8

Class EntityPresaveEvent.

Hierarchy

Expanded class hierarchy of EntityPresaveEvent

2 files declare their use of EntityPresaveEvent
ExampleEntityEventSubscribers.php in src/Example/ExampleEntityEventSubscribers.php
hook_event_dispatcher.module in ./hook_event_dispatcher.module
Hook event dispatcher module.

File

src/Event/Entity/EntityPresaveEvent.php, line 10

Namespace

Drupal\hook_event_dispatcher\Event\Entity
View source
class EntityPresaveEvent extends BaseEntityEvent {

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

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

}

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
EntityPresaveEvent::getDispatcherType public function Get the dispatcher type. Overrides EventInterface::getDispatcherType
EntityPresaveEvent::getOriginalEntity public function Get the original Entity.