You are here

function user_entity_dependencies in Entity Dependency API 7

Implements hook_entity_dependenies().

Related topics

File

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

Code

function user_entity_dependencies($entity, $entity_type) {
  if ($entity_type == 'user' && variable_get('user_pictures', 0) && !empty($entity->picture)) {
    $dependencies = array();
    $dependencies[] = array(
      'type' => 'file',
      'id' => $entity->picture->fid,
    );
    return $dependencies;
  }
}