Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Entity Events

1,335 sites Security covered Drupal 10–11 Entity ecosystem
View on drupal.org

This module dispatches events whenever an entity is created, updated, or deleted. It provides abstract classes that developers can extend to easily implement custom logic in response to these entity operations, serving as an alternative to using Drupal's traditional hooks.

Module which dispatches events for entity create, update, delete.

Provides abstract classes for event listeners for you to extend in your own modules to 'do stuff' on entity operations. Can use as a replacement for hook_entity_[update/insert/delete] from within your module file.

Abstract classes:

EntityEventSubscriber
EntityEventInsertSubscriber
EntityEventUpdateSubscriber
EntityEventDeleteSubscriber
EntityEventPredeleteSubscriber
EntityEventPresaveSubscriber

Extend these classes with your own module subscribers.

Example implementation

namespace Drupal\mymodule\EventSubscriber;

use Drupal\entity_events\Event\EntityEvent;
use Drupal\entity_events\EventSubscriber\EntityEventInsertSubscriber;

class MyModuleSubscriber extends EntityEventInsertSubscriber {

  public function onEntityInsert(EntityEvent $event) {
     // Implement your logic here.
  }

}

Remember to add event listeners to your services.yml.file
e.g.

services:
  mymodule.subscriber:
    class: Drupal\mymodule\EventSubscriber\MyModuleSubscriber
    tags:
      - {name: event_subscriber}

Drupal Core since 11.1 supports hooks in classes out of the box. See change record here https://www.drupal.org/node/3442349 . It is strongly recommended to use the core feature instead of this module.

Similar modules:

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Jan 2025
Latest release
1 month ago
Releases (12 mo)
1 ▼ from 2
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
2.1.0 Stable 10–11 Jul 22, 2026
2.0.5 Stable 9–11 Jun 21, 2025
2.0.4 Stable 9–11 Jan 30, 2025