CookiesServiceEntityListBuilder.php in COOKiES Consent Management 1.0.x
File
src/CookiesServiceEntityListBuilder.php
View source
<?php
namespace Drupal\cookies;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
class CookiesServiceEntityListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['label'] = $this
->t('COOKiES service entity');
$header['id'] = $this
->t('Machine name');
$header['group'] = $this
->t('Service Group');
$header['enabled'] = $this
->t('Enabled');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity
->label();
$row['id'] = $entity
->id();
$row['group'] = $entity
->get('group');
$row['enabled'] = $entity
->get('status') ? $this
->t('Enabled') : $this
->t('Disabled');
return $row + parent::buildRow($entity);
}
}