tripal_feature.api.inc 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. }