tripal_library.api.inc 1.9 KB

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