You are here

public function ReferenceListBuilder::buildRow in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_entity/src/ReferenceListBuilder.php \Drupal\bibcite_entity\ReferenceListBuilder::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

modules/bibcite_entity/src/ReferenceListBuilder.php, line 28

Class

ReferenceListBuilder
Defines a class to build a listing of Reference entities.

Namespace

Drupal\bibcite_entity

Code

public function buildRow(EntityInterface $entity) {

  /* @var $entity \Drupal\bibcite_entity\Entity\ReferenceInterface */
  $row['name'] = $entity
    ->toLink();
  $row['type'] = $entity
    ->get('type')->target_id;
  $account = $entity
    ->getOwner();
  $row['uid'] = $account
    ->isAnonymous() ? $account
    ->label() : $account
    ->toLink();
  return $row + parent::buildRow($entity);
}