function tripal_cv_update_cvtermpath
2.x tripal_cv.DEPRECATED.inc | tripal_cv_update_cvtermpath($cvid, $job_id = NULL) |
3.x tripal_cv.DEPRECATED.inc | tripal_cv_update_cvtermpath($cvid, $job_id = NULL) |
1.x tripal_cv.api.inc | tripal_cv_update_cvtermpath($cvid, $job_id = NULL) |
Updates the cvtermpath table of Chado for the specified CV.
Parameters
$cv_id: The chado cv_id;
$job_id: This function is intended to be used with the Tripal Jobs API. When this function is called as a job the $job_id is automatically passed to this function.
Return value
TRUE on success FALSE on failure
Related topics
1 call to tripal_cv_update_cvtermpath()
- tripal_cv_load_update_cvtermpath in tripal_cv/
includes/ obo_loader.inc
1 string reference to 'tripal_cv_update_cvtermpath'
- tripal_cv_cvtermpath_form_submit in tripal_cv/
includes/ tripal_cv_admin.inc - Cvterm path form submit
File
- tripal_cv/
api/ tripal_cv.api.inc, line 370 - Controlled Vocabulary API
Code
function tripal_cv_update_cvtermpath($cvid, $job_id = NULL) {
// TODO: need better error checking in this function
// first get the controlled vocabulary name:
$cv = db_fetch_object(chado_query("SELECT * FROM {cv} WHERE cv_id = %d", $cvid));
print "\nUpdating cvtermpath for $cv->name...\n";
// now fill the cvtermpath table
// @coder-ignore: using a function rather then tablename therefore table prefixing doesn't apply
$sql = "SELECT * FROM fill_cvtermpath('%s')";
$success = chado_query($sql, $cv->name);
return TRUE;
}