ResponsiveImageStyleListBuilder.php

Same filename in other branches
  1. 9 core/modules/responsive_image/src/ResponsiveImageStyleListBuilder.php
  2. 10 core/modules/responsive_image/src/ResponsiveImageStyleListBuilder.php
  3. 11.x core/modules/responsive_image/src/ResponsiveImageStyleListBuilder.php

Namespace

Drupal\responsive_image

File

core/modules/responsive_image/src/ResponsiveImageStyleListBuilder.php

View source
<?php

namespace Drupal\responsive_image;

use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;

/**
 * Provides a listing of responsive image styles.
 */
class ResponsiveImageStyleListBuilder extends ConfigEntityListBuilder {
    
    /**
     * {@inheritdoc}
     */
    public function buildHeader() {
        $header['label'] = t('Label');
        return $header + parent::buildHeader();
    }
    
    /**
     * {@inheritdoc}
     */
    public function buildRow(EntityInterface $entity) {
        $row['label'] = $entity->label();
        return $row + parent::buildRow($entity);
    }
    
    /**
     * {@inheritdoc}
     */
    public function getDefaultOperations(EntityInterface $entity) {
        $operations = parent::getDefaultOperations($entity);
        $operations['duplicate'] = [
            'title' => t('Duplicate'),
            'weight' => 15,
            'url' => $entity->toUrl('duplicate-form'),
        ];
        return $operations;
    }

}

Classes

Title Deprecated Summary
ResponsiveImageStyleListBuilder Provides a listing of responsive image styles.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.