You are here

ImageZoomOptionsListBuilder.php in Image Zoom 8.3

Namespace

Drupal\imagezoom

File

src/ImageZoomOptionsListBuilder.php
View source
<?php

namespace Drupal\imagezoom;

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

/**
 * Provides a listing of Image Zoom Options entities.
 */
class ImageZoomOptionsListBuilder extends ConfigEntityListBuilder {

  /**
   * {@inheritdoc}
   */
  public function buildHeader() {
    $header['label'] = $this
      ->t('Options profile');
    $header['id'] = $this
      ->t('Machine name');
    return $header + parent::buildHeader();
  }

  /**
   * {@inheritdoc}
   */
  public function buildRow(EntityInterface $entity) {
    $row['label'] = $entity
      ->label();
    $row['id'] = $entity
      ->id();
    return $row + parent::buildRow($entity);
  }

  /**
   * {@inheritdoc}
   */
  public function render() {
    $build = parent::render();
    $build['table']['#empty'] = $this
      ->t('There are no @label yet.', [
      '@label' => $this->entityType
        ->getPluralLabel(),
    ]);
    return $build;
  }

}

Classes

Namesort descending Description
ImageZoomOptionsListBuilder Provides a listing of Image Zoom Options entities.