statistics.info.inc 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * @file
  4. * Provides info about statistics.
  5. */
  6. /**
  7. * Implements hook_entity_property_info_alter() on top of statistics module.
  8. *
  9. * @see entity_entity_property_info_alter()
  10. */
  11. function entity_metadata_statistics_entity_property_info_alter(&$info) {
  12. $properties = &$info['node']['properties'];
  13. $properties['views'] = array(
  14. 'label' => t("Number of views"),
  15. 'description' => t("The number of visitors who have read the node."),
  16. 'type' => 'integer',
  17. 'getter callback' => 'entity_metadata_statistics_node_get_properties',
  18. 'computed' => TRUE,
  19. 'access callback' => 'entity_metadata_statistics_properties_access',
  20. );
  21. $properties['day_views'] = array(
  22. 'label' => t("Views today"),
  23. 'description' => t("The number of visitors who have read the node today."),
  24. 'type' => 'integer',
  25. 'getter callback' => 'entity_metadata_statistics_node_get_properties',
  26. 'computed' => TRUE,
  27. 'access callback' => 'entity_metadata_statistics_properties_access',
  28. );
  29. $properties['last_view'] = array(
  30. 'label' => t("Last view"),
  31. 'description' => t("The date on which a visitor last read the node."),
  32. 'type' => 'date',
  33. 'getter callback' => 'entity_metadata_statistics_node_get_properties',
  34. 'computed' => TRUE,
  35. 'access callback' => 'entity_metadata_statistics_properties_access',
  36. );
  37. }