You are here

entity_usage.api.php in Entity Usage 8.3

Same filename and directory in other branches
  1. 8.4 entity_usage.api.php
  2. 8.2 entity_usage.api.php

Hooks for the entity_usage module.

File

entity_usage.api.php
View source
<?php

/**
 * @file
 * Hooks for the entity_usage module.
 */

/**
 * @addtogroup hooks
 * @{
 */

/**
 * Allows modules to block a specific tracking record.
 *
 * Modules implementing this hook should return TRUE if the operation should
 * be blocked. Any other return value will be disregarded and the register
 * written to the database.
 *
 * @param int $target_id
 *   The target entity ID.
 * @param string $target_type
 *   The target entity type.
 * @param int $source_id
 *   The source entity ID.
 * @param string $source_type
 *   The source entity type.
 * @param string $source_langcode
 *   The source entity language code.
 * @param string $source_vid
 *   The source entity revision ID.
 */
function hook_entity_usage_block_tracking($target_id, $target_type, $source_id, $source_type, $source_langcode, $source_vid) {
  if ($source_type === 'foo' && $target_type === 'bar') {
    return TRUE;
  }
  return FALSE;
}

/**
 * @} End of "addtogroup hooks".
 */

Functions

Namesort descending Description
hook_entity_usage_block_tracking Allows modules to block a specific tracking record.