Backup of db before drupal security update
[yaffs-website] / web / core / modules / block_content / src / BlockContentTypeListBuilder.php
1 <?php
2
3 namespace Drupal\block_content;
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 custom block type entities.
10  *
11  * @see \Drupal\block_content\Entity\BlockContentType
12  */
13 class BlockContentTypeListBuilder extends ConfigEntityListBuilder {
14
15   /**
16    * {@inheritdoc}
17    */
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;
24     }
25     return $operations;
26   }
27
28   /**
29    * {@inheritdoc}
30    */
31   public function buildHeader() {
32     $header['type'] = t('Block type');
33     $header['description'] = t('Description');
34     return $header + parent::buildHeader();
35   }
36
37   /**
38    * {@inheritdoc}
39    */
40   public function buildRow(EntityInterface $entity) {
41     $row['type'] = $entity->link();
42     $row['description']['data']['#markup'] = $entity->getDescription();
43     return $row + parent::buildRow($entity);
44   }
45
46   /**
47    * {@inheritdoc}
48    */
49   protected function getTitle() {
50     return $this->t('Custom block types');
51   }
52
53 }