better_statistics.module in Better Statistics 8
Same filename and directory in other branches
Contains better_statistics.module.
File
better_statistics.moduleView source
<?php
/**
* @file
* Contains better_statistics.module.
*/
use Drupal\Core\Entity\EntityInterface;
/**
* Implements hook_entity_update().
*/
function better_statistics_entity_update(EntityInterface $entity) {
$current_user = \Drupal::service('current_user');
\Drupal::service('better_statistics.entity_interaction_collector')
->actionTypeTrigger($entity, $current_user, 'Update');
}
/**
* Implements hook_entity_insert().
*/
function better_statistics_entity_insert(EntityInterface $entity) {
$current_user = \Drupal::service('current_user');
if ($entity
->getEntityTypeId() != 'sapi_data') {
\Drupal::service('better_statistics.entity_interaction_collector')
->actionTypeTrigger($entity, $current_user, 'Create');
}
}
Functions
Name | Description |
---|---|
better_statistics_entity_insert | Implements hook_entity_insert(). |
better_statistics_entity_update | Implements hook_entity_update(). |