You are here

public function RedhenNote::buildContent in RedHen CRM 7

Override buildContent() to add note properties.

Overrides Entity::buildContent

File

modules/redhen_note/lib/redhen_note.entity.inc, line 33
Redhen Group entity classes

Class

RedhenNote
The class used for note entities.

Code

public function buildContent($view_mode = 'full', $langcode = NULL) {
  $wrapper = entity_metadata_wrapper('redhen_note', $this);
  $author = $wrapper->author
    ->value();
  $content['author'] = array(
    '#theme' => 'redhen_property_field',
    '#label' => t('Author'),
    '#items' => array(
      array(
        '#markup' => $author->name,
      ),
    ),
    '#classes' => 'field field-label-inline clearfix',
  );
  $content['created'] = array(
    '#theme' => 'redhen_property_field',
    '#label' => t('Created'),
    '#items' => array(
      array(
        '#markup' => redhen_format_date($this->created),
      ),
    ),
    '#classes' => 'field field-label-inline clearfix',
  );
  return entity_get_controller($this->entityType)
    ->buildContent($this, $view_mode, $langcode, $content);
}