You are here

class EntityPresaveEvent in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x modules/core_event_dispatcher/src/Event/Entity/EntityPresaveEvent.php \Drupal\core_event_dispatcher\Event\Entity\EntityPresaveEvent

Class EntityPresaveEvent.

Hierarchy

Expanded class hierarchy of EntityPresaveEvent

2 files declare their use of EntityPresaveEvent
core_event_dispatcher.module in modules/core_event_dispatcher/core_event_dispatcher.module
Core event dispatcher submodule.
ExampleEntityEventSubscribers.php in examples/ExampleEntityEventSubscribers.php

File

modules/core_event_dispatcher/src/Event/Entity/EntityPresaveEvent.php, line 11

Namespace

Drupal\core_event_dispatcher\Event\Entity
View source
class EntityPresaveEvent extends AbstractEntityEvent {

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

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

}

Members

Namesort descending Modifiers Type Description Overrides
AbstractEntityEvent::$entity protected property The Entity.
AbstractEntityEvent::getEntity public function Get the Entity.
AbstractEntityEvent::__construct public function AbstractEntityEvent constructor. 4
EntityPresaveEvent::getDispatcherType public function Get the dispatcher type. Overrides EventInterface::getDispatcherType
EntityPresaveEvent::getOriginalEntity public function Get the original Entity.