You are here

abstract class EntityEventSubscriber in Entity Events 8

Same name and namespace in other branches
  1. 2.0.x src/EventSubscriber/EntityEventSubscriber.php \Drupal\entity_events\EventSubscriber\EntityEventSubscriber

Event subscriber for entity delete event.

Hierarchy

  • class \Drupal\entity_events\EventSubscriber\EntityEventSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of EntityEventSubscriber

File

src/EventSubscriber/EntityEventSubscriber.php, line 12

Namespace

Drupal\entity_events\EventSubscriber
View source
abstract class EntityEventSubscriber implements EventSubscriberInterface {

  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents() {
    $events[EntityEventType::INSERT][] = [
      'onEntityInsert',
      800,
    ];
    $events[EntityEventType::UPDATE][] = [
      'onEntityUpdate',
      800,
    ];
    $events[EntityEventType::DELETE][] = [
      'onEntityDelete',
      800,
    ];
    return $events;
  }

  /**
   * Method called when entity is created.
   *
   * @param \Drupal\entity_events\Event\EntityEvent $event
   *   The event.
   */
  public function onEntityInsert(EntityEvent $event) {
  }

  /**
   * Method called when entity is updated.
   *
   * @param \Drupal\entity_events\Event\EntityEvent $event
   *   The event.
   */
  public function onEntityUpdate(EntityEvent $event) {
  }

  /**
   * Method called when entity is deleted.
   *
   * @param \Drupal\entity_events\Event\EntityEvent $event
   *   The event.
   */
  public function onEntityDelete(EntityEvent $event) {
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityEventSubscriber::getSubscribedEvents public static function
EntityEventSubscriber::onEntityDelete public function Method called when entity is deleted.
EntityEventSubscriber::onEntityInsert public function Method called when entity is created.
EntityEventSubscriber::onEntityUpdate public function Method called when entity is updated.