You are here

public function DataPolicyListBuilder::buildRow in Data Policy 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

src/DataPolicyListBuilder.php, line 29

Class

DataPolicyListBuilder
Defines a class to build a listing of Data policy entities.

Namespace

Drupal\data_policy

Code

public function buildRow(EntityInterface $entity) {

  /* @var \Drupal\data_policy\Entity\DataPolicyInterface $entity */
  $row['name'] = Link::createFromRoute($entity
    ->label(), 'entity.data_policy.revision', [
    'entity_id' => $entity
      ->id(),
    'data_policy_revision' => $entity
      ->getRevisionId(),
  ]);
  $row['id'] = $entity
    ->id();
  $row['revisions'] = count($this->storage
    ->revisionIds($entity));
  return $row + parent::buildRow($entity);
}