Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / shortcut / src / ShortcutSetListBuilder.php
1 <?php
2
3 namespace Drupal\shortcut;
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 shortcut set entities.
10  *
11  * @see \Drupal\shortcut\Entity\ShortcutSet
12  */
13 class ShortcutSetListBuilder extends ConfigEntityListBuilder {
14
15   /**
16    * {@inheritdoc}
17    */
18   public function buildHeader() {
19     $header['name'] = t('Name');
20     return $header + parent::buildHeader();
21   }
22
23   /**
24    * {@inheritdoc}
25    */
26   public function getDefaultOperations(EntityInterface $entity) {
27     $operations = parent::getDefaultOperations($entity);
28
29     if (isset($operations['edit'])) {
30       $operations['edit']['title'] = t('Edit shortcut set');
31     }
32
33     $operations['list'] = [
34       'title' => t('List links'),
35       'url' => $entity->urlInfo('customize-form'),
36     ];
37     return $operations;
38   }
39
40   /**
41    * {@inheritdoc}
42    */
43   public function buildRow(EntityInterface $entity) {
44     $row['name'] = $entity->label();
45     return $row + parent::buildRow($entity);
46   }
47
48 }