function tripal_cv_get_cv_id

2.x tripal_cv.DEPRECATED.inc tripal_cv_get_cv_id($cv_name)
3.x tripal_cv.DEPRECATED.inc tripal_cv_get_cv_id($cv_name)
1.x tripal_cv.api.inc tripal_cv_get_cv_id($cv_name)

Retrieve the cv id for the specified CV by name

NOTE: This function is deprecated.

Parameters

$cv_name: The unique name for the cv to retrieve

Return value

The numeric cv ID

See also

tripal_core_chado_generate_vars()

Related topics

1 call to tripal_cv_get_cv_id()

File

tripal_cv/api/tripal_cv.api.inc, line 152
Controlled Vocabulary API

Code

function tripal_cv_get_cv_id($cv_name) {

  $sql = "
    SELECT cv_id FROM {cv} WHERE name = '%s'
  ";
  $cv = db_fetch_object(chado_query($sql, $cv_name));

  return $cv->cv_id;
}