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()
- tripal_cv_admin_set_defaults_form in tripal_cv/
includes/ tripal_cv.admin.inc - tripal_cv_get_cv_options in tripal_cv/
api/ tripal_cv.DEPRECATED.inc
1 string reference to 'tripal_get_cv_select_options'
- tripal_cv_get_cv_options in tripal_cv/
api/ tripal_cv.DEPRECATED.inc
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;
}