You are here

protected function EntityAPIController::renderEntityProperty in Entity API 7

Renders a single entity property.

1 call to EntityAPIController::renderEntityProperty()
EntityAPIController::buildContent in includes/entity.controller.inc
Implements EntityAPIControllerInterface.

File

includes/entity.controller.inc, line 638
Provides a controller building upon the core controller but providing more features like full CRUD functionality.

Class

EntityAPIController
A controller implementing EntityAPIControllerInterface for the database.

Code

protected function renderEntityProperty($wrapper, $name, $property, $view_mode, $langcode, &$content) {
  $info = $property
    ->info();
  $content[$name] = array(
    '#label_hidden' => FALSE,
    '#label' => $info['label'],
    '#entity_wrapped' => $wrapper,
    '#theme' => 'entity_property',
    '#property_name' => $name,
    '#access' => $property
      ->access('view'),
    '#entity_type' => $this->entityType,
  );
  $content['#attached']['css']['entity.theme'] = drupal_get_path('module', 'entity') . '/theme/entity.theme.css';
}