You are here

public function ShareMessageController::buildContent in Share Message 7

Overrides EntityAPIController::buildContent().

Don't trigger the view rule because the event is not defined.

Overrides EntityAPIController::buildContent

File

includes/sharemessage.ui.inc, line 26
Definition of ShareMessageController and ShareMessageUIController classes.

Class

ShareMessageController
Controller class for the ShareMessage entity.

Code

public function buildContent($entity, $view_mode = 'full', $langcode = NULL, $content = array()) {

  // Remove previously built content, if exists.
  $entity->content = $content;
  $langcode = isset($langcode) ? $langcode : $GLOBALS['language_content']->language;

  // Add in fields.
  if (!empty($this->entityInfo['fieldable'])) {

    // Perform the preparation tasks if they have not been performed yet.
    // An internal flag prevents the operation from running twice.
    $key = isset($entity->{$this->idKey}) ? $entity->{$this->idKey} : NULL;
    field_attach_prepare_view($this->entityType, array(
      $key => $entity,
    ), $view_mode);
    $entity->content += field_attach_view($this->entityType, $entity, $view_mode, $langcode);
  }
  module_invoke_all($this->entityType . '_view', $entity, $view_mode, $langcode);
  module_invoke_all('entity_view', $entity, $this->entityType, $view_mode, $langcode);
  $build = $entity->content;
  unset($entity->content);
  return $build;
}