3 namespace Drupal\{{ machine_name }};
5 use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
6 use Drupal\Core\Entity\EntityInterface;
9 * Provides a listing of {{ entity_type_label|lower|plural }}.
11 class {{ class_prefix }}ListBuilder extends ConfigEntityListBuilder {
16 public function buildHeader() {
17 $header['label'] = $this->t('Label');
18 $header['id'] = $this->t('Machine name');
19 $header['status'] = $this->t('Status');
20 return $header + parent::buildHeader();
26 public function buildRow(EntityInterface $entity) {
27 /** @var \Drupal\{{ machine_name }}\{{ class_prefix }}Interface $entity */
28 $row['label'] = $entity->label();
29 $row['id'] = $entity->id();
30 $row['status'] = $entity->status() ? $this->t('Enabled') : $this->t('Disabled');
31 return $row + parent::buildRow($entity);