You are here

EntityEventUpdateSubscriber.php in Entity Events 2.0.x

Same filename and directory in other branches
  1. 8 src/EventSubscriber/EntityEventUpdateSubscriber.php

File

src/EventSubscriber/EntityEventUpdateSubscriber.php
View source
<?php

namespace Drupal\entity_events\EventSubscriber;

use Drupal\entity_events\EntityEventType;
use Drupal\entity_events\Event\EntityEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
 * Event subscriber for entity update event.
 */
abstract class EntityEventUpdateSubscriber implements EventSubscriberInterface {

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

  /**
   * Method called when Event occurs.
   *
   * @param \Drupal\entity_events\Event\EntityEvent $event
   *   The event.
   */
  public abstract function onEntityUpdate(EntityEvent $event);

}

Classes

Namesort descending Description
EntityEventUpdateSubscriber Event subscriber for entity update event.