function chado_db_select
3.x tripal_chado.query.api.inc | chado_db_select($table, $alias = NULL, array $options = array()) |
A replacment for db_select when querying Chado.
Use this function instead of db_select when querying Chado tables.
Parameters
$table: The base table for this query. May be a string or another SelectQuery object. If a query object is passed, it will be used as a subselect.
$alias: The alias for the base table of this query.
$options: An array of options to control how the query operates.
Return value
A new SelectQuery object for this connection.
Related topics
1 call to chado_db_select()
- tripal_chado_field_storage_query in tripal_chado/
includes/ tripal_chado.field_storage.inc - Implements hook_field_storage_query().
File
- tripal_chado/
api/ tripal_chado.query.api.inc, line 2064 - Provides an API for querying of chado including inserting, updating, deleting and selecting from chado.
Code
function chado_db_select($table, $alias = NULL, array $options = array()) {
if (empty($options['target'])) {
$options['target'] = 'default';
}
$conninfo = Database::getConnectionInfo();
$conn = new ChadoDatabaseConnection($conninfo['default']);
return $conn->select($table, $alias, $options);
}