function tripal_get_db
2.x tripal_db.api.inc | tripal_get_db($identifiers, $options = array()) |
3.x tripal_chado.module.DEPRECATED.api.inc | tripal_get_db($identifiers, $options = array()) |
Retrieves a chado db variable.
Example Usage:
$select_values = array(
'name' => 'SOFP'
);
$db_object = tripal_get_db($select_values);
The above code selects the SOFP db and returns the following object:
$db_object = stdClass Object (
[db_id] => 49
[name] => SOFP
[description] =>
[urlprefix] =>
[url] =>
);
Parameters
$identifier: An array with the key stating what the identifier is. Supported keys (only on of the following unique keys is required):
- db_id: the chado db.db_id primary key.
- name: the chado db.name field (assume unique).
$options: An array of options. Supported keys include:
- Any keys supported by chado_generate_var(). See that function definition for additional details.
NOTE: the $identifier parameter can really be any array similar to $values passed into chado_select_record(). It should fully specify the db record to be returned.
Return value
If unique values were passed in as an identifier then an object describing the cv will be returned (will be a chado variable from chado_generate_var()). Otherwise, an array of objects will be returned.
3 calls to tripal_get_db()
- tripal_db_get_db in legacy/
tripal_db/ api/ tripal_db.DEPRECATED.inc - tripal_db_get_db_by_db_id in legacy/
tripal_db/ api/ tripal_db.DEPRECATED.inc - tripal_db_get_db_by_name in legacy/
tripal_db/ api/ tripal_db.DEPRECATED.inc
3 string references to 'tripal_get_db'
- tripal_db_get_db in legacy/
tripal_db/ api/ tripal_db.DEPRECATED.inc - tripal_db_get_db_by_db_id in legacy/
tripal_db/ api/ tripal_db.DEPRECATED.inc - tripal_db_get_db_by_name in legacy/
tripal_db/ api/ tripal_db.DEPRECATED.inc
File
- tripal_chado/
api/ modules/ tripal_chado.module.DEPRECATED.api.inc, line 469 - These api functions are deprecated, if your site is currently using them please update your code with the newer tripal_chado functions.
Code
function tripal_get_db($identifiers, $options = array()) {
chado_get_db($identifiers, $options);
}