|
@@ -0,0 +1,40 @@
|
|
|
+<?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;
|
|
|
+ }
|
|
|
+}
|