Further changes for the Use cases on the live site.
[yaffs-website] / web / core / modules / responsive_image / src / ResponsiveImageStyleListBuilder.php
1 <?php
2
3 namespace Drupal\responsive_image;
4
5 use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
6 use Drupal\Core\Entity\EntityInterface;
7
8 /**
9  * Provides a listing of responsive image styles.
10  */
11 class ResponsiveImageStyleListBuilder extends ConfigEntityListBuilder {
12
13   /**
14    * {@inheritdoc}
15    */
16   public function buildHeader() {
17     $header['label'] = t('Label');
18     $header['id'] = t('Machine name');
19     return $header + parent::buildHeader();
20   }
21
22   /**
23    * {@inheritdoc}
24    */
25   public function buildRow(EntityInterface $entity) {
26     $row['label'] = $entity->label();
27     $row['id'] = $entity->id();
28     return $row + parent::buildRow($entity);
29   }
30
31   /**
32    * {@inheritdoc}
33    */
34   public function getDefaultOperations(EntityInterface $entity) {
35     $operations = parent::getDefaultOperations($entity);
36     $operations['duplicate'] = [
37       'title' => t('Duplicate'),
38       'weight' => 15,
39       'url' => $entity->urlInfo('duplicate-form'),
40     ];
41     return $operations;
42   }
43
44 }