123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace Drupal\dr8_zth;
- use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
- use Drupal\Core\Entity\EntityInterface;
- /**
- * Class BlogTypeListBuilder is the list builder for BlogType entities.
- */
- class BlogTypeListBuilder extends ConfigEntityListBuilder {
- /**
- * {@inheritdoc}
- */
- public function buildHeader() {
- $parentHeader = parent::buildHeader();
- $header = [
- $this->t('Type'),
- $this->t('Name'),
- $this->t('Description'),
- ];
- $ret = array_merge($header, $parentHeader);
- return $ret;
- }
- /**
- * {@inheritdoc}
- */
- public function buildRow(EntityInterface $entity) {
- assert($entity instanceof BlogTypeInterface);
- $row = [
- $entity->label(),
- $entity->id(),
- $entity->getDescription(),
- ];
- $ret = array_merge($row, parent::buildRow($entity));
- return $ret;
- }
- }
|