You are here

audit_log.module in Audit Log 8.2

Same filename and directory in other branches
  1. 8 audit_log.module
  2. 7 audit_log.module

Contains hook implementations for the audit_log module.

File

audit_log.module
View source
<?php

/**
 * @file
 * Contains hook implementations for the audit_log module.
 */
use Drupal\Core\Entity\EntityInterface;

/**
 * Implements hook_entity_update().
 */
function audit_log_entity_update(EntityInterface $entity) {
  \Drupal::service('audit_log.logger')
    ->log('update', $entity);
}

/**
 * Implements hook_entity_insert().
 */
function audit_log_entity_insert(EntityInterface $entity) {
  \Drupal::service('audit_log.logger')
    ->log('insert', $entity);
}

/**
 * Implements hook_entity_delete().
 */
function audit_log_entity_delete(EntityInterface $entity) {
  \Drupal::service('audit_log.logger')
    ->log('delete', $entity);
}

/**
 * Implements hook_theme().
 */
function audit_log_theme($existing, $type, $theme, $path) {
  return [
    'audit_log' => [
      'render element' => 'element',
      'file' => 'audit_log.page.inc',
    ],
  ];
}