misc_tables.views.inc 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * @file
  4. * Purpose: Allows the feature module to add fields to other module views
  5. *
  6. * For example, a field counting the number of features associted with a given organism would be
  7. * added to the organism view as follows:
  8. * @code
  9. $data['organism']['num_features'] = array(
  10. 'title' => 'Number of features',
  11. 'help' => 'Provides a count of the number of features associated with a given organism',
  12. 'field' => array(
  13. 'handler' => 'views_handler_field_chado_count',
  14. 'table_to_query' => 'feature',
  15. ),
  16. );
  17. * @endcode
  18. *
  19. * @ingroup tripal_feature_views
  20. */
  21. function retrieve_feature_misc_tables_views_data() {
  22. $data = array();
  23. // Table: Organism--------------------------------------------------------------------------------
  24. // Calculated Field: Number of features (Count -Int)
  25. // Provides the number of features for a given organism
  26. $data['organism']['num_features'] = array(
  27. 'title' => 'Number of Features',
  28. 'help' => 'Provides a count of the number of features associated with a given organism',
  29. 'field' => array(
  30. 'handler' => 'views_handler_field_chado_count',
  31. 'table_to_query' => 'feature',
  32. ),
  33. );
  34. // Table: Library---------------------------------------------------------------------------------
  35. // Calculated Field: Number of features (Count -Int)
  36. // Provides the number of features for a given organism
  37. $data['library']['num_features'] = array(
  38. 'title' => 'Number of Features',
  39. 'help' => 'Provides a count of the number of features associated with a given library',
  40. 'field' => array(
  41. 'handler' => 'views_handler_field_chado_count',
  42. 'table_to_query' => 'library_feature',
  43. ),
  44. );
  45. // Table: Analysis--------------------------------------------------------------------------------
  46. // Calculated Field: Number of features (Count -Int)
  47. // Provides the number of features for a given organism
  48. $data['analysis']['num_features'] = array(
  49. 'title' => 'Number of Features',
  50. 'help' => 'Provides a count of the number of features associated with a given analysis',
  51. 'field' => array(
  52. 'handler' => 'views_handler_field_chado_count',
  53. 'table_to_query' => 'analysisfeature',
  54. ),
  55. );
  56. return $data;
  57. }