TripalVocabViewsController.inc 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. *
  4. */
  5. class TripalVocabViewsController extends EntityDefaultViewsController {
  6. /**
  7. * Edit or add extra fields to views_data().
  8. */
  9. public function views_data() {
  10. $data = parent::views_data();
  11. $data['tripal_vocab']['table']['group'] = 'Tripal Term Vocabulary';
  12. $data['tripal_vocab']['vocabulary']['title'] = 'Vocabulary';
  13. $data['tripal_vocab']['vocabulary']['help'] = t('The short name of the vocabulary.');
  14. // Join the term to it's entity type.
  15. $data['tripal_vocab']['table']['join']['tripal_term'] = array(
  16. 'handler' => 'views_join',
  17. 'left_field' => 'vocab_id',
  18. 'field' => 'id',
  19. );
  20. // It is not intended that the following fields will every be used by the
  21. // end-user.
  22. unset($data['tripal_vocab']['id']);
  23. unset($data['tripal_vocab']['changed']);
  24. unset($data['tripal_vocab']['created']);
  25. // This should not be a base table. It's not useful to create a
  26. // view of the tripal_term table.
  27. unset($data['tripal_vocab']['table']['base']);
  28. return $data;
  29. }
  30. }