You are here

QuizQuestionTypeListBuilder.php in Quiz 6.x

File

src/Config/Entity/QuizQuestionTypeListBuilder.php
View source
<?php

namespace Drupal\quiz\Config\Entity;

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

/**
 * Defines the list builder for quiz question types.
 */
class QuizQuestionTypeListBuilder extends ConfigEntityListBuilder {
  public function render() {
    $build = parent::render();
    $build['table']['#caption'] = t('Question types.');
    return $build;
  }

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

  /**
   * {@inheritdoc}
   */
  public function buildRow(EntityInterface $entity) {
    $row['type'] = $entity
      ->toLink(NULL, 'edit-form');
    return $row + parent::buildRow($entity);
  }

}

Classes

Namesort descending Description
QuizQuestionTypeListBuilder Defines the list builder for quiz question types.