AggregatorItemViewsData.php 3.63 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?php

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

namespace Drupal\aggregator;

use Drupal\views\EntityViewsDataInterface;

/**
 * Provides the views data for the aggregator item entity type.
 */
class AggregatorItemViewsData implements EntityViewsDataInterface {

  /**
   * {@inheritdoc}
   */
  public function getViewsData() {
    $data = array();

    $data['aggregator_item']['table']['group'] = t('Aggregator');

    $data['aggregator_item']['table']['base'] = array(
      'field' => 'iid',
      'title' => t('Aggregator item'),
      'help' => t('Aggregator items are imported from external RSS and Atom news feeds.'),
    );
    $data['aggregator_item']['table']['entity type'] = 'aggregator_item';

    $data['aggregator_item']['iid'] = array(
      'title' => t('Item ID'),
      'help' => t('The unique ID of the aggregator item.'),
      'field' => array(
        'id' => 'numeric',
      ),
      'argument' => array(
        'id' => 'aggregator_iid',
        'name field' => 'title',
        'numeric' => TRUE,
      ),
      'filter' => array(
        'id' => 'numeric',
      ),
      'sort' => array(
        'id' => 'standard',
      ),
    );

    $data['aggregator_item']['title'] = array(
      'title' => t('Title'),
      'help' => t('The title of the aggregator item.'),
      'field' => array(
        'id' => 'aggregator_title_link',
        'extra' => array('link'),
      ),
      'argument' => array(
        'id' => 'string',
      ),
      'sort' => array(
        'id' => 'standard',
      ),
      'filter' => array(
        'id' => 'string',
      ),
    );

    $data['aggregator_item']['link'] = array(
      'title' => t('Link'),
      'help' => t('The link to the original source URL of the item.'),
      'field' => array(
        'id' => 'url',
      ),
      'argument' => array(
        'id' => 'string',
      ),
      'sort' => array(
        'id' => 'standard',
      ),
      'filter' => array(
        'id' => 'string',
      ),
    );

    $data['aggregator_item']['author'] = array(
      'title' => t('Author'),
      'help' => t('The author of the original imported item.'),
      'field' => array(
        'id' => 'aggregator_xss',
      ),
      'argument' => array(
        'id' => 'string',
      ),
      'sort' => array(
        'id' => 'standard',
      ),
      'filter' => array(
        'id' => 'string',
      ),
    );

    $data['aggregator_item']['guid'] = array(
      'title' => t('GUID'),
      'help' => t('The guid of the original imported item.'),
      'field' => array(
        'id' => 'standard',
      ),
      'argument' => array(
        'id' => 'string',
      ),
      'sort' => array(
        'id' => 'standard',
      ),
      'filter' => array(
        'id' => 'string',
      ),
    );

    $data['aggregator_item']['description'] = array(
      'title' => t('Body'),
      'help' => t('The actual content of the imported item.'),
      'field' => array(
        'id' => 'aggregator_xss',
        'click sortable' => FALSE,
      ),
      'argument' => array(
        'id' => 'string',
      ),
      'filter' => array(
        'id' => 'string',
      ),
      'sort' => array(
        'id' => 'standard',
      ),
    );

    $data['aggregator_item']['timestamp'] = array(
      'title' => t('Timestamp'),
      'help' => t('The date the original feed item was posted. (With some feeds, this will be the date it was imported.)'),
      'field' => array(
        'id' => 'date',
      ),
      'sort' => array(
        'id' => 'date',
      ),
      'filter' => array(
        'id' => 'date',
      ),
      'argument' => array(
        'id' => 'date',
      ),
    );

    return $data;
  }

}