View source
<?php
class RedhenEngagementMetadataController extends EntityDefaultMetadataController {
public function entityPropertyInfo() {
$info = parent::entityPropertyInfo();
$properties =& $info[$this->type]['properties'];
$properties['created'] = array(
'label' => t("Created"),
'description' => t("The date the note was created."),
'type' => 'date',
'schema field' => 'created',
'filter' => TRUE,
'field_type' => 'textfield',
);
$properties['entity'] = array(
'label' => t("Source entity"),
'type' => 'entity',
'description' => t("The host entity."),
'getter callback' => 'redhen_engagement_property_source_get',
'setter callback' => 'entity_property_verbatim_set',
);
$properties['contact'] = array(
'label' => t("Contact"),
'type' => 'redhen_contact',
'description' => t("The redhen_contact this engagement applies to."),
'schema field' => 'contact_id',
'setter callback' => 'entity_property_verbatim_set',
'required' => TRUE,
);
$properties['author'] = array(
'label' => t("Author"),
'type' => 'user',
'description' => t("The author of the note."),
'schema field' => 'author_uid',
'required' => TRUE,
);
$properties['engagement_score'] = array(
'label' => t('Engagement score'),
'type' => 'redhen_engagement_score',
'schema field' => 'engagement_score',
'description' => t('The engagement score.'),
'options list' => 'redhen_engagement_score_options',
'setter callback' => 'entity_property_verbatim_set',
'field_type' => 'select',
'filter' => TRUE,
'required' => TRUE,
);
return $info;
}
}