function tripal_get_cv_select_options

2.x tripal_cv.api.inc tripal_get_cv_select_options()
3.x tripal_chado.module.DEPRECATED.api.inc tripal_get_cv_select_options()

Create an options array to be used in a form element which provides a list of all chado cvs

Return value

An array(cv_id => name) for each cv in the chado cv table

Related topics

2 calls to tripal_get_cv_select_options()
1 string reference to 'tripal_get_cv_select_options'

File

tripal_cv/api/tripal_cv.api.inc, line 114
This module provides a set of functions to simplify working with controlled vocabularies.

Code

function tripal_get_cv_select_options() {

  $results = chado_select_record('cv', array('cv_id', 'name'), array(), array('order_by' => array('name' => 'ASC')));

  $options = array();
  foreach ($results as $r) {
    $options[$r->cv_id] = $r->name;
  }

  return $options;

}