AggregatorItemViewsData.php 1.91 KB
Newer Older
1
2
3
4
5
6
7
8
9
<?php

/**
 * @file
 * Contains \Drupal\aggregator\AggregatorItemViewsData.
 */

namespace Drupal\aggregator;

10
use Drupal\views\EntityViewsData;
11
12
13
14

/**
 * Provides the views data for the aggregator item entity type.
 */
15
class AggregatorItemViewsData extends EntityViewsData {
16
17
18
19
20

  /**
   * {@inheritdoc}
   */
  public function getViewsData() {
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    $data = parent::getViewsData();

    $data['aggregator_item']['table']['base']['help'] = $this->t('Aggregator items are imported from external RSS and Atom news feeds.');

    $data['aggregator_item']['iid']['help'] = $this->t('The unique ID of the aggregator item.');
    $data['aggregator_item']['iid']['argument']['id'] = 'aggregator_iid';
    $data['aggregator_item']['iid']['argument']['name field'] = 'title';
    $data['aggregator_item']['iid']['argument']['numeric'] = TRUE;

    $data['aggregator_item']['title']['help'] = $this->t('The title of the aggregator item.');
    $data['aggregator_item']['title']['field']['id'] = 'aggregator_title_link';
    $data['aggregator_item']['title']['field']['extra'] = 'link';

    $data['aggregator_item']['link']['help'] = $this->t('The link to the original source URL of the item.');

    $data['aggregator_item']['author']['help'] = $this->t('The author of the original imported item.');
37
38

    $data['aggregator_item']['author']['field']['default_formatter'] = 'aggregator_xss';
39
40
41
42

    $data['aggregator_item']['guid']['help'] = $this->t('The guid of the original imported item.');

    $data['aggregator_item']['description']['help'] = $this->t('The actual content of the imported item.');
43
    $data['aggregator_item']['description']['field']['default_formatter'] = 'aggregator_xss';
44
45
46
    $data['aggregator_item']['description']['field']['click sortable'] = FALSE;

    $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.)');
47
48
49
50
51

    return $data;
  }

}