You are here

public function SourceListBuilder::buildRow in Backup and Migrate 5.0.x

Same name and namespace in other branches
  1. 8.4 src/Controller/SourceListBuilder.php \Drupal\backup_migrate\Controller\SourceListBuilder::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.

Overrides EntityListBuilder::buildRow

See also

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

File

src/Controller/SourceListBuilder.php, line 26

Class

SourceListBuilder
Provides a listing of Backup Source entities.

Namespace

Drupal\backup_migrate\Controller

Code

public function buildRow(EntityInterface $entity) {
  $row['label'] = $entity
    ->label();
  $row['id'] = $entity
    ->id();
  $row['type'] = $entity
    ->get('type');
  if ($info = $entity
    ->getPluginDefinition()) {
    $row['type'] = $info['title'];
  }
  return $row + parent::buildRow($entity);
}