1: <?php
2:
3: namespace webservices\listing;
4:
5: use \PDO as PDO;
6:
7: 8: 9: 10:
11: class Isoforms extends \WebService {
12:
13: 14: 15:
16: public function execute($querydata) {
17:
18: global $db;
19: $constant = 'constant';
20:
21: if (false)
22: $db = new PDO();
23:
24: $param_unigene_feature_id = $querydata['query1'];
25:
26: $query_get_isoforms = <<<EOF
27: SELECT isoform.uniquename, isoform.feature_id, isoform.name
28: FROM feature AS isoform, feature_relationship
29: WHERE
30: feature_relationship.object_id = :unigene_feature_id
31: AND isoform.feature_id = feature_relationship.subject_id
32: AND isoform.type_id = {$constant('CV_ISOFORM')}
33: EOF;
34:
35: $stm_get_isoforms = $db->prepare($query_get_isoforms);
36: $stm_get_isoforms->bindValue('unigene_feature_id', $param_unigene_feature_id);
37:
38: $data = array('results' => array());
39:
40: $stm_get_isoforms->execute();
41: while ($isoform = $stm_get_isoforms->fetch(PDO::FETCH_ASSOC)) {
42: $data['isoforms'][] = array('uniquename' => $isoform['uniquename'], 'name' => $isoform['name'], 'feature_id' => $isoform['feature_id'], 'type'=>'isoform');
43: }
44:
45:
46: return $data;
47: }
48:
49: }
50:
51: ?>
52: