You are here

public function RobotListBuilder::buildRow in Examples for Developers 3.x

Same name and namespace in other branches
  1. 8 config_entity_example/src/Controller/RobotListBuilder.php \Drupal\config_entity_example\Controller\RobotListBuilder::buildRow()

Builds a row for an entity in the entity listing.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity for which to build the row.

Return value

array A render array of the table row for displaying the entity.

Overrides EntityListBuilder::buildRow

See also

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

File

modules/config_entity_example/src/Controller/RobotListBuilder.php, line 64

Class

RobotListBuilder
Provides a listing of robot entities.

Namespace

Drupal\config_entity_example\Controller

Code

public function buildRow(EntityInterface $entity) {
  $row['label'] = $entity
    ->label();
  $row['machine_name'] = $entity
    ->id();
  $row['floopy'] = $entity->floopy;
  return $row + parent::buildRow($entity);
}