You are here

activity.module in Activity 8

Activity file events.

File

activity.module
View source
<?php

/**
 * @file
 * Activity file events.
 */
use Drupal\Core\Entity\EntityInterface;

/**
 * Implements hook_ENTITY_update().
 */
function activity_entity_update(EntityInterface $entity) {
  \Drupal::service('query_activity')
    ->logActivity($entity, $entity
    ->getEntityTypeId() . '_update');
}

/**
 * Implements hook_ENTITY_insert().
 */
function activity_entity_insert(EntityInterface $entity) {
  \Drupal::service('query_activity')
    ->logActivity($entity, $entity
    ->getEntityTypeId() . '_insert');
}

/**
 * Implements hook_ENTITY_delete().
 */
function activity_entity_delete(EntityInterface $entity) {
  \Drupal::service('query_activity')
    ->logActivity($entity, $entity
    ->getEntityTypeId() . '_delete');
}

Functions

Namesort descending Description
activity_entity_delete Implements hook_ENTITY_delete().
activity_entity_insert Implements hook_ENTITY_insert().
activity_entity_update Implements hook_ENTITY_update().