heartbeat.views.inc 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * @file
  4. * Contains heartbeat\heartbeat.views.inc..
  5. * Provide a custom views field data that isn't tied to any other module. */
  6. use Drupal\Component\Utility\NestedArray;
  7. use Drupal\Core\Entity\EntityStorageInterface;
  8. use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
  9. use Drupal\Core\Render\Markup;
  10. use Drupal\field\FieldConfigInterface;
  11. use Drupal\field\FieldStorageConfigInterface;
  12. use Drupal\system\ActionConfigEntityInterface;
  13. /**
  14. * Implements hook_views_data().
  15. */
  16. function heartbeat_views_data() {
  17. $data['views']['table']['group'] = t('Custom Global');
  18. $data['views']['table']['join'] = array(
  19. // #global is a special flag which allows a table to appear all the time.
  20. '#global' => array(),
  21. );
  22. $data['views']['heartbeat_message_field'] = array(
  23. 'title' => t('Heartbeat message field'),
  24. 'help' => t('Heartbeat field formatter which allows for rendering of HTML'),
  25. 'field' => array(
  26. 'id' => 'heartbeat_message_field',
  27. ),
  28. );
  29. return $data;
  30. }