MicrositeListBuilder.php in Entity Reference Hierarchy 8.2
File
modules/entity_hierarchy_microsite/src/MicrositeListBuilder.php
View source
<?php
namespace Drupal\entity_hierarchy_microsite;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
class MicrositeListBuilder extends EntityListBuilder {
public function buildHeader() {
return [
'name' => $this
->t('Name'),
'home' => $this
->t('Home page'),
] + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
return [
'name' => $entity
->toLink(NULL, 'edit-form'),
'home' => $entity
->getHome() ? $entity
->getHome()
->toLink() : $this
->t('N/A'),
] + parent::buildRow($entity);
}
}