ReferenceListBuilder.php in Bibliography & Citation 2.0.x
File
modules/bibcite_entity/src/ReferenceListBuilder.php
View source
<?php
namespace Drupal\bibcite_entity;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
class ReferenceListBuilder extends EntityListBuilder {
public function buildHeader() {
$header['name'] = $this
->t('Title');
$header['type'] = $this
->t('Type');
$header['uid'] = $this
->t('Authored by');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$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);
}
}