Overview

Namespaces

  • cli_db
    • propel
      • map
      • om
  • cli_import
  • LoggedPDO
  • None
  • PHP
  • webservices
    • cart
    • combisearch
    • details
      • annotations
        • feature
    • graphs
      • barplot
      • genome
    • listing
    • queue

Classes

  • Dbxref
  • Interpro_predpeps
  • Mapman
  • Pub
  • Repeatmasker
  • Synonym
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: 
 3: namespace webservices\details\annotations\feature;
 4: 
 5: use \PDO as PDO;
 6: /**
 7:  * Web Service.
 8:  * Get all synonyms and acssociated publications for a feature
 9:  */
10: class Synonym extends \WebService {
11: 
12:     public function getById($param_feature_id) {
13: 
14: 
15:         global $db;
16: #UI hint
17:         if (false)
18:             $db = new PDO();
19: 
20:                 $stm_get_synonyms = $db->prepare(<<<EOF
21: SELECT 
22:         synonym.synonym_id,
23:         synonym.name AS synonym_name, 
24:         cvterm.name AS synonym_type,
25:         pub.*,
26:         array_to_string((SELECT array_agg(Surname||', '||Givennames) FROM PubAuthor pa WHERE pa.pub_id = pub.pub_id ),' and ') as author
27:         
28: FROM feature_synonym 
29:         JOIN pub ON (feature_synonym.pub_id = pub.pub_id)
30:     JOIN synonym ON (feature_synonym.synonym_id = synonym.synonym_id) 
31:     JOIN cvterm ON (synonym.type_id = cvterm.cvterm_id)
32: WHERE feature_synonym.feature_id =  :feature_id
33: EOF
34:                 );
35:         $stm_get_synonyms->bindValue('feature_id', $param_feature_id);
36:         
37:         
38:     
39:         $ret = array();
40: 
41:         $stm_get_synonyms->execute();
42:         while ($synonym = $stm_get_synonyms->fetch(PDO::FETCH_ASSOC)) {
43:                 $ret[$synonym['synonym_id']] = $synonym;
44:         }
45: 
46:         return $ret;
47:     }
48: 
49:     /**
50:      * @inheritDoc
51:      */
52:     public function execute($querydata) {
53: 
54:         return $this->getById($querydata['query1']);
55:     }
56: 
57: }
58: ?>
59: 
tbro API documentation generated by ApiGen 2.8.0