FlippingBookListBuilder.php in Flipping Book 8
File
src/FlippingBookListBuilder.php
View source
<?php
namespace Drupal\flipping_book;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\Core\Link;
class FlippingBookListBuilder extends EntityListBuilder {
public function buildHeader() {
$header['id'] = $this
->t('Flipping Book ID');
$header['name'] = $this
->t('Name');
$header['type'] = $this
->t('Type');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['id'] = $entity
->id();
$row['name'] = Link::createFromRoute($entity
->label(), 'entity.flipping_book.edit_form', [
'flipping_book' => $entity
->id(),
]);
$row['type'] = $entity
->getTypeLabel();
return $row + parent::buildRow($entity);
}
}