AggregatorItemViewsData.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace Drupal\aggregator;
  3. use Drupal\views\EntityViewsData;
  4. /**
  5. * Provides the views data for the aggregator item entity type.
  6. */
  7. class AggregatorItemViewsData extends EntityViewsData {
  8. /**
  9. * {@inheritdoc}
  10. */
  11. public function getViewsData() {
  12. $data = parent::getViewsData();
  13. $data['aggregator_item']['table']['base']['help'] = $this->t('Aggregator items are imported from external RSS and Atom news feeds.');
  14. $data['aggregator_item']['iid']['help'] = $this->t('The unique ID of the aggregator item.');
  15. $data['aggregator_item']['iid']['argument']['id'] = 'aggregator_iid';
  16. $data['aggregator_item']['iid']['argument']['name field'] = 'title';
  17. $data['aggregator_item']['iid']['argument']['numeric'] = TRUE;
  18. $data['aggregator_item']['title']['help'] = $this->t('The title of the aggregator item.');
  19. $data['aggregator_item']['title']['field']['default_formatter'] = 'aggregator_title';
  20. $data['aggregator_item']['link']['help'] = $this->t('The link to the original source URL of the item.');
  21. $data['aggregator_item']['author']['help'] = $this->t('The author of the original imported item.');
  22. $data['aggregator_item']['author']['field']['default_formatter'] = 'aggregator_xss';
  23. $data['aggregator_item']['guid']['help'] = $this->t('The guid of the original imported item.');
  24. $data['aggregator_item']['description']['help'] = $this->t('The actual content of the imported item.');
  25. $data['aggregator_item']['description']['field']['default_formatter'] = 'aggregator_xss';
  26. $data['aggregator_item']['description']['field']['click sortable'] = FALSE;
  27. $data['aggregator_item']['timestamp']['help'] = $this->t('The date the original feed item was posted. (With some feeds, this will be the date it was imported.)');
  28. return $data;
  29. }
  30. }