You are here

public function EntityLegalDocumentListBuilder::buildRow in Entity Legal 3.0.x

Same name and namespace in other branches
  1. 8.2 src/EntityLegalDocumentListBuilder.php \Drupal\entity_legal\EntityLegalDocumentListBuilder::buildRow()
  2. 4.0.x src/EntityLegalDocumentListBuilder.php \Drupal\entity_legal\EntityLegalDocumentListBuilder::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/EntityLegalDocumentListBuilder.php, line 27

Class

EntityLegalDocumentListBuilder
Defines a class to build a listing of entity legal document entities.

Namespace

Drupal\entity_legal

Code

public function buildRow(EntityInterface $entity) {
  $label = Link::createFromRoute($entity
    ->label(), 'entity.entity_legal_document.canonical', [
    'entity_legal_document' => $entity
      ->id(),
  ])
    ->toString();
  $row['label'] = $this
    ->t('@label <small>(Machine name: @id)</small>', [
    '@label' => $label,
    '@id' => $entity
      ->id(),
  ]);
  return $row + parent::buildRow($entity);
}