Yaffs site version 1.1
[yaffs-website] / vendor / drupal / console / templates / module / src / entity-listbuilder.php.twig
1 {% extends "base/class.php.twig" %}
2
3 {% block file_path %}
4 \Drupal\{{module}}\{{ entity_class }}ListBuilder.
5 {% endblock %}
6
7 {% block namespace_class %}
8 namespace Drupal\{{module}};
9 {% endblock %}
10
11 {% block use_class %}
12 use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
13 use Drupal\Core\Entity\EntityInterface;
14 {% endblock %}
15
16 {% block class_declaration %}
17 /**
18  * Provides a listing of {{ label }} entities.
19  */
20 class {{ entity_class }}ListBuilder extends ConfigEntityListBuilder {% endblock %}
21 {% block class_methods %}
22   /**
23    * {@inheritdoc}
24    */
25   public function buildHeader() {
26     $header['label'] = $this->t('{{ label }}');
27     $header['id'] = $this->t('Machine name');
28     return $header + parent::buildHeader();
29   }
30
31   /**
32    * {@inheritdoc}
33    */
34   public function buildRow(EntityInterface $entity) {
35     $row['label'] = $entity->label();
36     $row['id'] = $entity->id();
37     // You probably want a few more properties here...
38     return $row + parent::buildRow($entity);
39   }
40 {% endblock %}