1 entity.module | entity_build_content(EntityInterface $entity = NULL, $view_mode = 'full', $langcode = NULL) |
Builds a structured array representing the entity's content.
The content built for the entity will vary depending on the $view_mode parameter.
Parameters
Entity $entity: An entity object.
string $view_mode: A view mode as used by this entity type, e.g. 'full', 'teaser'...
string $langcode: (optional) A language code to use for rendering. Defaults to the global content language of the current request.
File
- core/
modules/ entity/ entity.module, line 225 - Entity API for handling entities like nodes or users.
Code
function entity_build_content(EntityInterface $entity = NULL, $view_mode = 'full', $langcode = NULL) {
$info = entity_get_info($entity->entityType());
if (in_array('EntityControllerInterface', class_implements($info['controller class']))) {
entity_get_controller($entity->entityType())->buildContent($entity, $view_mode, $langcode);
}
}