You are here

public function CorrespondingReferenceListBuilder::buildRow in Corresponding Entity References 8.4

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/CorrespondingReferenceListBuilder.php, line 24

Class

CorrespondingReferenceListBuilder
The list builder for Corresponding Reference entities.

Namespace

Drupal\cer

Code

public function buildRow(EntityInterface $entity) {

  /** @var CorrespondingReferenceInterface $entity */
  $row = [
    'label' => $entity
      ->label(),
    'id' => $entity
      ->id(),
    'fields' => $this
      ->getCorrespondingFields($entity),
    'enabled' => $entity
      ->isEnabled() ? $this
      ->t('Yes') : $this
      ->t('No'),
  ];
  return $row + parent::buildRow($entity);
}