Hi,
is there any "hello world" example code how to integrate custom entity to views?
I have achieved creating new view with "Show" set to my entity. But when I want to edit my view, I don't see any filter criteria or fields to add. The View Format I have set as follows:
Format:Unformatted list
Show: Entity
When I create some entity content, the view does display each content as "Unlabeled". So at least it registers my entity content.
I have this implementation of hook_entoty_property_info:
<?php
function upozornenia_entity_property_info() {
$info = array();
$properties = & $info['upozornenie']['properties'];
$properties['nid'] = array(
'label' => t("Node ID"),
'type' => 'integer',
'description' => t("The unique ID of the node."),
'schema field' => 'nid',
);
$properties['up_id'] = array(
'label' => t("ID upozornenia"),
'description' => t("ID upozornenia"),
'type' => 'integer',
'schema field' => 'up_id',
);
$properties['author'] = array(
'label' => t("Author"),
'type' => 'user',
'description' => t("The author of the upozornenie."),
'required' => TRUE,
'schema field' => 'uid',
);
return $info;
}
?>
As I understand, array items in hook_entity_property_info should automatically show in views as filters ad fields. Am I correct?