You are here

RegistrationTypeListBuilder.php in RNG - Events and Registrations 8

Namespace

Drupal\rng\Lists

File

src/Lists/RegistrationTypeListBuilder.php
View source
<?php

namespace Drupal\rng\Lists;

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

/**
 * Builds a list of registration types.
 */
class RegistrationTypeListBuilder extends ConfigEntityListBuilder {

  /**
   * {@inheritdoc}
   */
  public function buildHeader() {
    $header['label'] = $this
      ->t('Registration type');
    $header['machine_name'] = $this
      ->t('Machine Name');
    return $header + parent::buildHeader();
  }

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

  /**
   * {@inheritdoc}
   */
  public function render() {
    $render = parent::render();
    $render['table']['#empty'] = t('No registration types found.');
    return $render;
  }

}

Classes

Namesort descending Description
RegistrationTypeListBuilder Builds a list of registration types.