tripal_library.api.inc 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. /**
  3. * Implements hook_chado_library_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 library table
  9. *
  10. * @ingroup tripal_library
  11. */
  12. function tripal_library_chado_library_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']['cvterm'] = array(
  22. 'table' => 'cvterm',
  23. 'columns' => array(
  24. 'type_id' => 'cvterm_id',
  25. ),
  26. );
  27. $referring_tables = array(
  28. 'library_cvterm',
  29. 'library_feature',
  30. 'library_pub',
  31. 'library_synonym',
  32. 'libraryprop'
  33. );
  34. $description['referring_tables'] = $referring_tables;
  35. return $description;
  36. }
  37. /**
  38. * Implements hook_chado_library_feature_schema()
  39. * Purpose: To add descriptions and foreign keys to default table description
  40. * Note: This array will be merged with the array from all other implementations
  41. *
  42. * @return
  43. * Array describing the library_feature table
  44. *
  45. * @ingroup tripal_library
  46. */
  47. function tripal_library_chado_library_feature_schema() {
  48. $description = array();
  49. // Default table description in tripal_core.schema.api.inc: tripal_core_chado_library_feature_schema()
  50. $description['foreign keys']['library'] = array(
  51. 'table' => 'library',
  52. 'columns' => array(
  53. 'library_id' => 'library_id',
  54. ),
  55. );
  56. $description['foreign keys']['feature'] = array(
  57. 'table' => 'feature',
  58. 'columns' => array(
  59. 'feature_id' => 'feature_id',
  60. ),
  61. );
  62. return $description;
  63. }
  64. /**
  65. * Implements hook_chado_libraryprop_schema()
  66. * Purpose: To add descriptions and foreign keys to default table description
  67. * Note: This array will be merged with the array from all other implementations
  68. *
  69. * @return
  70. * Array describing the libraryprop table
  71. *
  72. * @ingroup tripal_library
  73. */
  74. function tripal_library_chado_libraryprop_schema() {
  75. $description = array();
  76. // Default table description in tripal_core.schema.api.inc: tripal_core_chado_library_feature_schema()
  77. $description['foreign keys']['library'] = array(
  78. 'table' => 'library',
  79. 'columns' => array(
  80. 'library_id' => 'library_id',
  81. ),
  82. );
  83. $description['foreign keys']['cvterm'] = array(
  84. 'table' => 'cvterm',
  85. 'columns' => array(
  86. 'type_id' => 'cvterm_id',
  87. ),
  88. );
  89. return $description;
  90. }