function getdirections_check_entity_type in Get Directions 7.3
Check that an entity type is location enabled.
9 calls to getdirections_check_entity_type()
- getdirections_access_user_location in ./
getdirections.module - getdirections_check_vocabulary in ./
getdirections.module - Check that a taxonomy type is fieldable.
- getdirections_direction in ./
getdirections.module - Function to setup the map and form
- getdirections_direction_box in ./
getdirections.module - for colorbox and suchlike
- getdirections_entity_setlocation in ./
getdirections.module - Function to setup the map
File
- ./
getdirections.module, line 2927 - Fetches google map directions.
Code
function getdirections_check_entity_type($entity_type = '', $bundle = '') {
if ($entity_type == 'term') {
$entity_type = 'taxonomy_term';
}
$module = getdirections_get_current_supported_module();
if ($module) {
$query = db_select('field_config', 'f');
$query
->fields('f', array(
'id',
));
$query
->join('field_config_instance', 'i', 'f.id=i.field_id');
$query
->condition('f.module', $module);
if ($entity_type) {
$query
->condition('i.entity_type', $entity_type);
}
if ($bundle) {
$query
->condition('i.bundle', $bundle);
}
$query
->condition('f.active', 1);
$number_of_rows = $query
->countQuery()
->execute()
->fetchField();
if ($number_of_rows) {
return TRUE;
}
}
return FALSE;
}