function relation_views_data in Relation 8.2
Same name and namespace in other branches
- 8 relation.views.inc \relation_views_data()
- 7 views/relation.views.inc \relation_views_data()
Implements hook_views_data().
File
- ./
relation.views.inc, line 19
Code
function relation_views_data() {
// Define the base group of this table.
$data['relation']['table']['group'] = t('Relation');
// Advertise this table as a possible base table.
$data['relation']['table']['base'] = array(
'field' => 'relation_id',
'title' => t('Relation'),
'weight' => -10,
);
$data['relation']['table']['entity type'] = 'relation';
$data['relation']['relation_id'] = array(
'title' => t('Relation ID'),
'help' => t('The relation ID.'),
'field' => array(
'id' => 'numeric',
'click sortable' => TRUE,
),
'argument' => array(
'handler' => 'numeric',
'numeric' => TRUE,
),
'filter' => array(
'id' => 'numeric',
),
'sort' => array(
'id' => 'sort',
),
);
$data['relation']['relation_type'] = array(
'title' => t('Relation type'),
'help' => t('The relation type.'),
'field' => array(
'id' => 'standard',
'click sortable' => TRUE,
),
'argument' => array(
'id' => 'string',
'numeric' => TRUE,
),
'filter' => array(
'id' => 'in_operator',
'options callback' => 'relation_get_types_options',
),
'sort' => array(
'id' => 'sort',
),
);
$data['relation']['revision_id'] = array(
'title' => t('Revision ID'),
'help' => t('The relation revision ID.'),
'field' => array(
'id' => 'numeric',
'click sortable' => TRUE,
),
'argument' => array(
'id' => 'numeric',
'numeric' => TRUE,
),
'filter' => array(
'id' => 'numeric',
),
'sort' => array(
'id' => 'sort',
),
);
$data['relation']['uid'] = array(
'title' => t('Uid'),
'help' => t('The relation uid.'),
'field' => array(
'id' => 'numeric',
'click sortable' => TRUE,
),
'argument' => array(
'id' => 'numeric',
'numeric' => TRUE,
),
'filter' => array(
'id' => 'numeric',
),
'sort' => array(
'id' => 'sort',
),
'relationship' => array(
'label' => 'relation author',
'title' => t('Relation Author'),
'base' => 'users_field_data',
'base field' => 'uid',
),
);
$data['relation']['created'] = array(
'title' => t('Create Date'),
'help' => t('The date when the relation was created.'),
'field' => array(
'id' => 'date',
'click sortable' => TRUE,
),
'argument' => array(
'id' => 'date',
'numeric' => TRUE,
),
'filter' => array(
'id' => 'date',
),
'sort' => array(
'id' => 'sort',
),
);
$data['relation']['changed'] = array(
'title' => t('Change Date'),
'help' => t('The date when the relation was last changed.'),
'field' => array(
'id' => 'date',
'click sortable' => TRUE,
),
'argument' => array(
'id' => 'date',
'numeric' => TRUE,
),
'filter' => array(
'id' => 'date',
),
'sort' => array(
'id' => 'sort',
),
);
$data['relation']['arity'] = array(
'title' => t('Number of endpoints'),
'help' => t('The number of endpoints in this relation.'),
'field' => array(
'id' => 'numeric',
'click sortable' => TRUE,
),
'argument' => array(
'id' => 'numeric',
'numeric' => TRUE,
),
'filter' => array(
'id' => 'numeric',
),
'sort' => array(
'id' => 'sort',
),
);
// View link.
$data['relation']['link'] = array(
'title' => t('Link'),
'help' => t('Provide a simple link to the relation entity.'),
'field' => array(
'handler' => 'views_handler_field_relation_link',
'click sortable' => TRUE,
'real field' => 'relation_id',
'additional fields' => array(
'relation_id',
),
),
);
// Edit link.
$data['relation']['edit'] = array(
'title' => t('Edit link'),
'help' => t('Provide a simple link to edit the relation entity.'),
'field' => array(
'handler' => 'views_handler_field_relation_link_edit',
'click sortable' => TRUE,
'real field' => 'relation_id',
'additional fields' => array(
'relation_id',
),
),
);
// Delete link.
$data['relation']['delete'] = array(
'title' => t('Delete link'),
'help' => t('Provide a simple link to delete the relation entity.'),
'field' => array(
'handler' => 'views_handler_field_relation_link_delete',
'click sortable' => TRUE,
'real field' => 'relation_id',
'additional fields' => array(
'relation_id',
),
),
);
return $data;
}