public function RedhenNoteMetadataController::entityPropertyInfo in RedHen CRM 7
Extend to set property attributes for RedHen Notes.
Overrides EntityDefaultMetadataController::entityPropertyInfo
File
- modules/
redhen_note/ lib/ redhen_note.metadata.inc, line 18
Class
- RedhenNoteMetadataController
- Controls metadata for Redhen notes
Code
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',
);
// Entities.
$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;
}