Version 1
[yaffs-website] / web / core / modules / config / tests / config_test / src / ConfigTestListBuilder.php
1 <?php
2
3 namespace Drupal\config_test;
4
5 use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
6 use Drupal\Core\Entity\EntityInterface;
7
8 /**
9  * Defines a class to build a listing of ConfigTest entities.
10  *
11  * @see \Drupal\config_test\Entity\ConfigTest
12  */
13 class ConfigTestListBuilder extends ConfigEntityListBuilder {
14
15   /**
16    * {@inheritdoc}
17    */
18   public function buildHeader() {
19     $header['label'] = t('Label');
20     $header['id'] = t('Machine name');
21     return $header + parent::buildHeader();
22   }
23
24   /**
25    * {@inheritdoc}
26    */
27   public function buildRow(EntityInterface $entity) {
28     $row['label'] = $entity->label();
29     $row['id'] = $entity->id();
30     return $row + parent::buildRow($entity);
31   }
32
33 }