function domain_entity_field_instances in Domain Access Entity 7
Get a keyed list of domain_entity field id and field name.
Return value
array Array of key(field_id) => field_instance_name.
1 call to domain_entity_field_instances()
- domain_entity_entity_field_instance in ./
domain_entity.module - Get the domain_entity field name and his settings for an entity type.
File
- ./
domain_entity.module, line 310 - Defines field (e.g. domain_entity) for entities, and access query alter.
Code
function domain_entity_field_instances() {
// First check the static cache for a domain_entity field instances array.
$domain_entity_field_instances =& drupal_static(__FUNCTION__);
// If it did not exist, fetch the fields now.
if (!isset($domain_entity_field_instances)) {
$query = "SELECT fc.id AS id, fc.field_name AS field_name ";
$query .= "FROM {field_config} fc WHERE ";
$query .= "(fc.type = 'domain_entity') AND (fc.active = 1)";
$domain_entity_field_instances = db_query($query)
->fetchAll(PDO::FETCH_KEY_PAIR);
}
return $domain_entity_field_instances;
}