public function EntityListController::buildRow

Builds a row for an entity in the entity listing.

Parameters

Drupal\Core\Entity\EntityInterface $entity: The entity for this row of the list.

Return value

array A render array structure of fields for this entity.

See also

Drupal\Core\Entity\EntityListController::render()

1 call to EntityListController::buildRow()
2 methods override EntityListController::buildRow()
CategoryListController::buildRow in drupal/core/modules/contact/lib/Drupal/contact/CategoryListController.php
Overrides Drupal\Core\Entity\EntityListController::buildRow().
ViewListController::buildRow in drupal/core/modules/views/views_ui/lib/Drupal/views_ui/ViewListController.php
Overrides Drupal\Core\Entity\EntityListController::buildRow();

File

drupal/core/lib/Drupal/Core/Entity/EntityListController.php, line 112
Definition of Drupal\Core\Entity\EntityListController.

Class

EntityListController
Provides a generic implementation of an entity list controller.

Namespace

Drupal\Core\Entity

Code

public function buildRow(EntityInterface $entity) {
  $row['label'] = $entity
    ->label();
  $row['id'] = $entity
    ->id();
  $operations = $this
    ->buildOperations($entity);
  $row['operations']['data'] = $operations;
  return $row;
}