You are here

EnvironmentListBuilder.php in Environment 8

File

src/Controller/EnvironmentListBuilder.php
View source
<?php

/**
 * @file
 * Contains Drupal\environment\Controller\EnvironmentListBuilder.
 */
namespace Drupal\environment\Controller;

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

/**
 * Provides a listing of Environment entities.
 */
class EnvironmentListBuilder extends ConfigEntityListBuilder {

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

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

}

Classes

Namesort descending Description
EnvironmentListBuilder Provides a listing of Environment entities.