You are here

FooTableBreakpointListBuilder.php in FooTable 8.2

Same filename and directory in other branches
  1. 8 src/FooTableBreakpointListBuilder.php

Namespace

Drupal\footable

File

src/FooTableBreakpointListBuilder.php
View source
<?php

namespace Drupal\footable;

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

/**
 * Defines a class to build a listing of FooTable breakpoint entities.
 *
 * @see \Drupal\footable\Entity\FooTableBreakpoint
 */
class FooTableBreakpointListBuilder extends ConfigEntityListBuilder {

  /**
   * {@inheritdoc}
   */
  public function buildHeader() {
    $header['label'] = $this
      ->t('Label');
    $header['name'] = $this
      ->t('Name');
    $header['breakpoint'] = $this
      ->t('Breakpoint');
    return $header + parent::buildHeader();
  }

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

}

Classes

Namesort descending Description
FooTableBreakpointListBuilder Defines a class to build a listing of FooTable breakpoint entities.