misc_tables.views.inc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * @file
  4. * Purpose: Allows the stock module to add fields to other module views
  5. *
  6. * For example, a field counting the number of stocks associted with a given organism would be
  7. * added to the organism view as follows:
  8. * @code
  9. $data['organism']['num_stocks'] = array(
  10. 'title' => 'Number of stocks',
  11. 'help' => 'Provides a count of the number of stocks associated with a given organism',
  12. 'field' => array(
  13. 'handler' => 'views_handler_field_chado_count',
  14. 'table_to_query' => 'stock',
  15. ),
  16. );
  17. * @endcode
  18. *
  19. * @ingroup tripal_stock_views
  20. */
  21. function retrieve_stock_misc_tables_views_data() {
  22. $data = array();
  23. // Table: Organism--------------------------------------------------------------------------------
  24. // Calculated Field: Number of stocks (Count -Int)
  25. // Provides the number of stocks for a given organism
  26. $data['organism']['num_stocks'] = array(
  27. 'title' => 'Number of Stocks',
  28. 'help' => 'Provides a count of the number of stocks associated with a given organism',
  29. 'field' => array(
  30. 'handler' => 'views_handler_field_chado_count',
  31. 'table_to_query' => 'stock',
  32. ),
  33. );
  34. return $data;
  35. }