You are here

function taxonomy_entity_dependencies in Entity Dependency API 7

Implements hook_entity_dependencies().

Related topics

File

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

Code

function taxonomy_entity_dependencies($entity, $entity_type) {
  if ($entity_type == 'taxonomy_term') {
    $dependencies = array();
    $terms = taxonomy_get_parents($entity->tid);
    foreach ($terms as $tid => $term) {
      $dependencies[] = array(
        'type' => 'taxonomy_term',
        'id' => $tid,
      );
    }
    return $dependencies;
  }
}