misc_tables.views.inc 1.2 KB

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