function _sarnia_entity_types in Sarnia 7
Get a list of Sarnia entity configurations without using entity APIs.
In most cases, field_info_bundles() is preferred, since it is part of Drupal core APIs.
See also
3 calls to _sarnia_entity_types()
- sarnia_entity_info in ./
sarnia.module - Implements hook_entity_info().
- sarnia_entity_property_info in ./
sarnia.module - Implements hook_entity_property_info().
- sarnia_features_pipe_alter in ./
sarnia.module - Implements hook_features_pipe_alter().
2 string references to '_sarnia_entity_types'
- sarnia_entity_type_delete in ./
sarnia.entities.inc - Delete a Sarnia entity type.
- sarnia_entity_type_save in ./
sarnia.entities.inc - Create or update a Sarnia entity type.
File
- ./
sarnia.entities.inc, line 11
Code
function _sarnia_entity_types($reset = FALSE) {
$types =& drupal_static(__FUNCTION__);
if ((!isset($types) || $reset) && db_table_exists('sarnia_entity_type')) {
// Get information about Sarnia entity types from the database.
$types = array();
$types = db_query("SELECT label, machine_name, search_api_server, search_api_index, id_field FROM {sarnia_entity_type}")
->fetchAllAssoc('machine_name', PDO::FETCH_ASSOC);
}
return $types;
}