tripal_feature.api.inc 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <?php
  2. /**
  3. * Implements hook_chado_feature_schema()
  4. * Purpose: To add descriptions and foreign keys to default table description
  5. * Note: This array will be merged with the array from all other implementations
  6. *
  7. * @return
  8. * Array describing the feature table
  9. *
  10. * @ingroup tripal_feature
  11. */
  12. function tripal_feature_chado_feature_schema() {
  13. $description = array();
  14. // Default table description in tripal_core.schema.api.inc: tripal_core_chado_feature_schema()
  15. $description['foreign keys']['organism'] = array(
  16. 'table' => 'organism',
  17. 'columns' => array(
  18. 'organism_id' => 'organism_id',
  19. ),
  20. );
  21. $description['foreign keys']['dbxref'] = array(
  22. 'table' => 'dbxref',
  23. 'columns' => array(
  24. 'dbxref_id' => 'dbxref_id',
  25. ),
  26. );
  27. $description['foreign keys']['cvterm'] = array(
  28. 'table' => 'cvterm',
  29. 'columns' => array(
  30. 'type_id' => 'cvterm_id',
  31. ),
  32. );
  33. $referring_tables = array('analysisfeature',
  34. 'element',
  35. 'feature_cvterm',
  36. 'feature_dbxref',
  37. 'feature_expression',
  38. 'feature_genotype',
  39. 'feature_phenotype',
  40. 'feature_pub',
  41. 'feature_relationship',
  42. 'feature_synonym',
  43. 'featureloc',
  44. 'featurepos',
  45. 'featureprop',
  46. 'featurerange',
  47. 'library_feature',
  48. 'phylonode',
  49. 'wwwuser_feature'
  50. );
  51. $description['referring_tables'] = $referring_tables;
  52. return $description;
  53. }
  54. /**
  55. * Implements hook_chado_featureprop_schema()
  56. * Purpose: To add descriptions and foreign keys to default table description
  57. * Note: This array will be merged with the array from all other implementations
  58. *
  59. * @return
  60. * Array describing the featureprop table
  61. *
  62. * @ingroup tripal_feature
  63. */
  64. function tripal_feature_chado_featureprop_schema() {
  65. $description = array();
  66. // Default table description in tripal_core.schema.api.inc: tripal_core_chado_featureprop_schema()
  67. $description['foreign keys']['feature'] = array(
  68. 'table' => 'feature',
  69. 'columns' => array(
  70. 'feature_id' => 'feature_id',
  71. ),
  72. );
  73. $description['foreign keys']['cvterm'] = array(
  74. 'table' => 'cvterm',
  75. 'columns' => array(
  76. 'type_id' => 'cvterm_id',
  77. ),
  78. );
  79. $referring_tables = array('analysisfeature',
  80. 'featureprop_pub',
  81. );
  82. $description['referring_tables'] = $referring_tables;
  83. return $description;
  84. }
  85. /**
  86. * Implements hook_chado_featureloc_schema()
  87. * Purpose: To add descriptions and foreign keys to default table description
  88. * Note: This array will be merged with the array from all other implementations
  89. *
  90. * @return
  91. * Array describing the featureloc table
  92. *
  93. * @ingroup tripal_feature
  94. */
  95. function tripal_feature_chado_featureloc_schema() {
  96. $description = array();
  97. // Default table description in tripal_core.schema.api.inc: tripal_core_chado_featureloc_schema()
  98. $description['foreign keys']['feature'] = array(
  99. 'table' => 'feature',
  100. 'columns' => array(
  101. 'feature_id' => 'feature_id',
  102. 'srcfeature_id' => 'feature_id'
  103. ),
  104. );
  105. $referring_tables = array('analysisfeature',
  106. 'featureloc_pub',
  107. );
  108. $description['referring_tables'] = $referring_tables;
  109. return $description;
  110. }
  111. /**
  112. * Implements hook_chado_feature_dbxref_schema()
  113. * Purpose: To add descriptions and foreign keys to default table description
  114. * Note: This array will be merged with the array from all other implementations
  115. *
  116. * @return
  117. * Array describing the feature_dbxref table
  118. *
  119. * @ingroup tripal_feature
  120. */
  121. function tripal_feature_chado_feature_dbxref_schema() {
  122. $description = array();
  123. // Default table description in tripal_core.schema.api.inc: tripal_core_chado_feature_dbxref_schema()
  124. $description['foreign keys']['feature'] = array(
  125. 'table' => 'feature',
  126. 'columns' => array(
  127. 'feature_id' => 'feature_id',
  128. ),
  129. );
  130. $description['foreign keys']['dbxref'] = array(
  131. 'table' => 'dbxref',
  132. 'columns' => array(
  133. 'dbxref_id' => 'dbxref_id',
  134. ),
  135. );
  136. return $description;
  137. }