You are here

function relation_view in Relation 7

2 calls to relation_view()
relation_multiple_view in ./relation.module
relation_ui_page in ./relation_ui.module
Relation display page. Currently only displays related entities.

File

./relation.module, line 480
Describes relations between entities.

Code

function relation_view($relation, $view_mode = 'full') {
  $entity_type = 'relation';
  $entity = $relation;
  $entities = array(
    $relation->rid => $relation,
  );
  field_attach_prepare_view($entity_type, $entities, $view_mode);
  entity_prepare_view($entity_type, $entities);
  $build = field_attach_view($entity_type, $entity, $view_mode);
  $build += array(
    '#entity' => $relation,
    '#view_mode' => $view_mode,
    '#language' => LANGUAGE_NONE,
  );
  module_invoke_all('entity_view', $entity, $entity_type, $view_mode, LANGUAGE_NONE);
  drupal_alter('entity_view', $build, $entity_type);
  return $build;
}