class RedhenNoteViewsController in RedHen CRM 7
RedhenMembership Views Controller class.
Hierarchy
- class \EntityDefaultViewsController
- class \RedhenNoteViewsController
Expanded class hierarchy of RedhenNoteViewsController
1 string reference to 'RedhenNoteViewsController'
- redhen_note_entity_info in modules/
redhen_note/ redhen_note.module - Implements hook_entity_info().
File
- modules/
redhen_note/ lib/ redhen_note.views.inc, line 6
View source
class RedhenNoteViewsController extends EntityDefaultViewsController {
/**
* Add extra fields to views_data().
*/
public function views_data() {
$data = parent::views_data();
$entity_info = entity_get_info();
foreach ($entity_info as $entity_type => $info) {
if ($entity_type == 'redhen_contact' || $entity_type == 'redhen_org') {
// Entity to note.
$data[$info['base table']]['redhen_note_rel'] = array(
'group' => t('Note'),
'title' => t('@entity to Note', array(
'@entity' => drupal_ucfirst($info['label']),
)),
'help' => t('The Note associated with the @entity entity.', array(
'@entity' => drupal_ucfirst($info['label']),
)),
'relationship' => array(
'entity' => $entity_type,
'label' => t('@entity being the Note', array(
'@entity' => $entity_type,
)),
'base' => 'redhen_note',
'base field' => 'entity_id',
'relationship field' => $info['entity keys']['id'],
),
);
// Note to entity.
$data['redhen_note']['redhen_note_related_' . $entity_type] = array(
'group' => t('Note'),
'title' => t('Note to @entity', array(
'@entity' => drupal_ucfirst($info['label']),
)),
'help' => t('The @entity entity that is associated with the Note.', array(
'@entity' => $info['label'],
)),
'relationship' => array(
'handler' => 'views_handler_relationship',
'label' => t('@entity from Note', array(
'@entity' => $entity_type,
)),
'base' => $info['base table'],
'base field' => $info['entity keys']['id'],
'relationship field' => 'entity_id',
),
);
}
}
return $data;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityDefaultViewsController:: |
protected | property | ||
EntityDefaultViewsController:: |
public | function | Determines the handler to use for a relationship to an entity type. | |
EntityDefaultViewsController:: |
protected | function | Comes up with views information based on the given schema and property info. | |
EntityDefaultViewsController:: |
public static | function | A callback returning property options, suitable to be used as views options callback. | |
EntityDefaultViewsController:: |
protected | function | Try to come up with some views fields with the help of the schema and the entity property information. | |
EntityDefaultViewsController:: |
protected | function | Try to come up with some views fields with the help of the revision schema and the entity property information. | |
EntityDefaultViewsController:: |
public | function | ||
RedhenNoteViewsController:: |
public | function |
Add extra fields to views_data(). Overrides EntityDefaultViewsController:: |