You are here

function domain_entity_allowed_entity_types_base_tables in Domain Access Entity 7

Return each base table of the allowed entity type.

3 calls to domain_entity_allowed_entity_types_base_tables()
domain_entity_query_alter in ./domain_entity.module
Implements hook_query_alter().
domain_entity_source_views_data_alter in domain_entity_source/domain_entity_source.module
Implements hook_views_data_alter().
domain_entity_views_data_alter in ./domain_entity.module
Implements hook_views_data_alter().

File

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

Code

function domain_entity_allowed_entity_types_base_tables() {

  // First check the static cache for a domain_entity field instances array.
  $domain_entity_allowed_entity_types_base_tables =& drupal_static(__FUNCTION__);

  // If it did not exist, fetch the types now.
  if (!isset($domain_entity_allowed_entity_types_base_tables)) {
    $domain_entity_allowed_entity_types_base_tables = array();
    $domain_entity_allowed_entity_types = domain_entity_allowed_entity_types();
    foreach ($domain_entity_allowed_entity_types as $entity_type => $bundles) {
      $entity_info = entity_get_info($entity_type);
      $domain_entity_allowed_entity_types_base_tables[$entity_info['base table']] = array(
        'entity key' => $entity_info['entity keys']['id'],
        'entity type' => $entity_type,
      );
    }
  }
  return $domain_entity_allowed_entity_types_base_tables;
}