You are here

public function TeamListBuilder::buildRow in Apigee Edge 8

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.

Overrides EntityListBuilder::buildRow

See also

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

File

modules/apigee_edge_teams/src/Entity/ListBuilder/TeamListBuilder.php, line 103

Class

TeamListBuilder
General entity listing builder for teams.

Namespace

Drupal\apigee_edge_teams\Entity\ListBuilder

Code

public function buildRow(EntityInterface $entity) {

  /** @var \Drupal\apigee_edge_teams\Entity\TeamInterface $entity */
  $row['name']['data'] = $entity
    ->toLink()
    ->toRenderable();
  $row['status']['data'] = [
    '#type' => 'status_property',
    '#value' => $entity
      ->getStatus(),
    '#indicator_status' => $entity
      ->getStatus() === TeamInterface::STATUS_ACTIVE ? StatusPropertyElement::INDICATOR_STATUS_OK : StatusPropertyElement::INDICATOR_STATUS_ERROR,
  ];
  return $row + parent::buildRow($entity);
}