misc_tables.views.inc 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. * @ingroup tripal_feature_views
  19. */
  20. function retrieve_feature_misc_tables_views_data() {
  21. $data = array();
  22. // Table: Organism--------------------------------------------------------------------------------
  23. // Calculated Field: Number of features (Count -Int)
  24. // Provides the number of features for a given organism
  25. $data['organism']['num_features'] = array(
  26. 'title' => 'Number of Features',
  27. 'help' => 'Provides a count of the number of features associated with a given organism',
  28. 'field' => array(
  29. 'handler' => 'views_handler_field_chado_count',
  30. 'table_to_query' => 'feature',
  31. ),
  32. );
  33. // Table: Library---------------------------------------------------------------------------------
  34. // Calculated Field: Number of features (Count -Int)
  35. // Provides the number of features for a given organism
  36. $data['library']['num_features'] = array(
  37. 'title' => 'Number of Features',
  38. 'help' => 'Provides a count of the number of features associated with a given library',
  39. 'field' => array(
  40. 'handler' => 'views_handler_field_chado_count',
  41. 'table_to_query' => 'library_feature',
  42. ),
  43. );
  44. // Table: Analysis--------------------------------------------------------------------------------
  45. // Calculated Field: Number of features (Count -Int)
  46. // Provides the number of features for a given organism
  47. $data['analysis']['num_features'] = array(
  48. 'title' => 'Number of Features',
  49. 'help' => 'Provides a count of the number of features associated with a given analysis',
  50. 'field' => array(
  51. 'handler' => 'views_handler_field_chado_count',
  52. 'table_to_query' => 'analysisfeature',
  53. ),
  54. );
  55. return $data;
  56. }