InformBlockListBuilder.php in Data Policy 8
File
src/Controller/InformBlockListBuilder.php
View source
<?php
namespace Drupal\data_policy\Controller;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
class InformBlockListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['label'] = $this
->t('Title');
$header['page'] = $this
->t('Page');
$header['enabled'] = $this
->t('Enabled');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity
->label();
$row['page'] = $entity->page;
$row['enabled'] = $entity->status === TRUE ? $this
->t('Yes') : $this
->t('No');
return $row + parent::buildRow($entity);
}
}