123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?php
-
-
- function tripal_analysis_chado_analysisfeature_schema() {
- $description = array();
- $description['foreign keys']['feature'] = array(
- 'table' => 'feature',
- 'columns' => array(
- 'feature_id' => 'feature_id',
- ),
- );
- $description['foreign keys']['analysis'] = array(
- 'table' => 'analysis',
- 'columns' => array(
- 'analysis_id' => 'analysis_id',
- ),
- );
-
- return $description;
- }
-
- function tripal_analysis_chado_analysisprop_schema() {
- $description = array();
- $description['foreign keys']['cvterm'] = array(
- 'table' => 'cvterm',
- 'columns' => array(
- 'type_id' => 'cvterm_id',
- ),
- );
- $description['foreign keys']['analysis'] = array(
- 'table' => 'analysis',
- 'columns' => array(
- 'analysis_id' => 'analysis_id',
- ),
- );
- return $description;
- }
- function tripal_analysis_get_property($analysis_id,$property){
-
- $values = array (
- 'analysis_id' => $analysis_id,
- 'type_id' => array (
- 'cv_id' => array (
- 'name' => 'tripal',
- ),
- 'name' => $property,
- 'is_obsolete' => 0
- ),
- );
- $columns = array('type_id','value');
- $results = tripal_core_chado_select('analysisprop',$columns,$values);
-
- foreach($results as $prop){
- $prop->type_id = new stdClass();
- $prop->type_id->table_name = 'cvterm';
- $prop->type_id->name = $property;
- }
- return $results;
- }
- function tripal_analysis_insert_property($analysis_id,$property,$value){
-
- $values = array (
- 'analysis_id' => $analysis_id,
- 'type_id' => array (
- 'cv_id' => array (
- 'name' => 'tripal',
- ),
- 'name' => $property,
- 'is_obsolete' => 0
- ),
- 'value' => $value,
- 'rank' => 0,
- );
- return tripal_core_chado_insert('analysisprop',$values);
- }
- function tripal_analysis_update_property($analysis_id,$property,$value){
-
- $match = array (
- 'analysis_id' => $analysis_id,
- 'type_id' => array (
- 'cv_id' => array (
- 'name' => 'tripal',
- ),
- 'name' => $property,
- ),
- );
-
- $values = array (
- 'value' => $value,
- );
- return tripal_core_chado_update('analysisprop',$match,$values);
- }
|