function rules_entity_delete

Same name in other branches
  1. 7.x-2.x modules/events.inc \rules_entity_delete()

Implements hook_entity_delete().

3 string references to 'rules_entity_delete'
ActionsFormTest::dataActionsFormWidgets in tests/src/Functional/ActionsFormTest.php
Provides data for testActionsFormWidgets().
ContextIntegrationTest::testAssignmentRestriction in tests/src/Kernel/ContextIntegrationTest.php
Tests the assignment restriction on context definitions.
EntityDeleteTest::setUp in tests/src/Unit/Integration/RulesAction/EntityDeleteTest.php

File

./rules.module, line 149

Code

function rules_entity_delete(EntityInterface $entity) {
    // Only handle content entities and ignore config entities.
    if ($entity instanceof ContentEntityInterface) {
        $entity_type_id = $entity->getEntityTypeId();
        $event = new EntityEvent($entity, [
            $entity_type_id => $entity,
        ]);
        $event_dispatcher = \Drupal::service('event_dispatcher');
        $event_dispatcher->dispatch($event, "rules_entity_delete:{$entity_type_id}");
    }
}