View source
<?php
class RedhenNoteMetadataController 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',
'filter' => TRUE,
'field_type' => 'textfield',
'schema field' => 'created',
'setter callback' => 'entity_property_verbatim_set',
'getter callback' => 'entity_property_verbatim_date_get',
);
$properties['updated'] = array(
'label' => t("Updated"),
'description' => t("The date the note was updated."),
'type' => 'date',
'schema field' => 'updated',
'setter callback' => 'entity_property_verbatim_set',
'getter callback' => 'entity_property_verbatim_date_get',
);
$properties['author'] = array(
'label' => t("Author entity"),
'type' => 'user',
'description' => t("The author of the note."),
'schema field' => 'author_uid',
'required' => TRUE,
'getter callback' => 'entity_property_verbatim_get',
'setter callback' => 'entity_property_verbatim_set',
);
$properties['entity'] = array(
'label' => t("Host entity"),
'type' => 'entity',
'schema field' => 'entity',
'description' => t("The host entity."),
'getter callback' => 'redhen_note_property_host_get',
'setter callback' => 'entity_property_verbatim_set',
'required' => TRUE,
);
return $info;
}
}