3 namespace Drupal\block_content;
5 use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
6 use Drupal\Core\Entity\EntityInterface;
9 * Defines a class to build a listing of custom block type entities.
11 * @see \Drupal\block_content\Entity\BlockContentType
13 class BlockContentTypeListBuilder extends ConfigEntityListBuilder {
18 public function getDefaultOperations(EntityInterface $entity) {
19 $operations = parent::getDefaultOperations($entity);
20 // Place the edit operation after the operations added by field_ui.module
21 // which have the weights 15, 20, 25.
22 if (isset($operations['edit'])) {
23 $operations['edit']['weight'] = 30;
31 public function buildHeader() {
32 $header['type'] = t('Block type');
33 $header['description'] = t('Description');
34 return $header + parent::buildHeader();
40 public function buildRow(EntityInterface $entity) {
41 $row['type'] = $entity->link();
42 $row['description']['data']['#markup'] = $entity->getDescription();
43 return $row + parent::buildRow($entity);
49 protected function getTitle() {
50 return $this->t('Custom block types');