misc_tables.views.inc 2.2 KB

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