You are here

function hook_entity_usage_block_tracking in Entity Usage 8.3

Same name and namespace in other branches
  1. 8.4 entity_usage.api.php \hook_entity_usage_block_tracking()
  2. 8.2 entity_usage.api.php \hook_entity_usage_block_tracking()

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.

Parameters

int $target_id: The target entity ID.

string $target_type: The target entity type.

int $source_id: The source entity ID.

string $source_type: The source entity type.

string $source_langcode: The source entity language code.

string $source_vid: The source entity revision ID.

1 function implements hook_entity_usage_block_tracking()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

entity_usage_test_entity_usage_block_tracking in tests/modules/entity_usage_test/entity_usage_test.module
Implements hook_entity_usage_block_tracking().
1 invocation of hook_entity_usage_block_tracking()
EntityUsage::registerUsage in src/EntityUsage.php
Register a new usage record.

File

./entity_usage.api.php, line 33
Hooks for the entity_usage module.

Code

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;
}