FrontendEnvironmentListBuilder.php in Build Hooks 8.2
File
src/FrontendEnvironmentListBuilder.php
View source
<?php
namespace Drupal\build_hooks;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
class FrontendEnvironmentListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['label'] = $this
->t('Frontend environment');
$header['plugin'] = $this
->t('Type');
$header['id'] = $this
->t('Machine name');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity
->label();
$row['plugin'] = $entity
->getPlugin()
->getPluginDefinition()['label'];
$row['id'] = $entity
->id();
return $row + parent::buildRow($entity);
}
}