1 entity.class.inc public Entity::view($view_mode = 'full', $langcode = NULL, $page = NULL)

Implements EntityInterface::view().

Overrides EntityInterface::view

File

core/modules/entity/entity.class.inc, line 339
Provides an interface and a base class for entities.

Class

Entity
Defines a base entity class.

Code

public function view($view_mode = 'full', $langcode = NULL, $page = NULL) {
  // It is null for newly created, but we need it as array key.
  $id = (string) $this->id();
  $view = entity_get_controller($this->entityType())->view(array($id => $this), $view_mode, $langcode, $page);
  return $view[$this->entityType()][$id];
}