You are here

function domain_entity_entity_info_alter in Domain Access Entity 7

Implements hook_entity_info_alter().

Make sure entities used by domain_entity are fieldable.

File

./domain_entity.module, line 368
Defines field (e.g. domain_entity) for entities, and access query alter.

Code

function domain_entity_entity_info_alter(&$entity_info) {
  $entities = domain_entity_allowed_entity_types();
  foreach ($entities as $entity_name => $entity_bundles) {
    $entity_info[$entity_name]['fieldable'] = TRUE;

    // Store the default access callback before we change it.
    if (isset($entity_info[$entity_name]['access callback'])) {
      $entity_info[$entity_name]['default access callback'] = $entity_info[$entity_name]['access callback'];
    }
    $entity_info[$entity_name]['access callback'] = 'domain_entity_entity_access_callback';
  }
}