You are here

function node_entity_dependencies in Entity Dependency API 7

Implements hook_entity_dependenies().

Related topics

File

./entity_dependency.core.inc, line 16
Contains hook implementations for all relevant core module.

Code

function node_entity_dependencies($entity, $entity_type) {
  if ($entity_type == 'node') {
    $dependencies = array();

    // The node has a 'user' dependency through the 'uid' and
    // 'revision_uid' properties.
    entity_dependency_add($dependencies, $entity, 'user', array(
      'uid',
      'revision_uid',
    ));

    // The node has a 'node' dependency through the 'tnid' property.
    entity_dependency_add($dependencies, $entity, 'node', 'tnid');
    return $dependencies;
  }
}