QuizQuestionListBuilder.php in Quiz 6.x
File
src/Config/Entity/QuizQuestionListBuilder.php
View source
<?php
namespace Drupal\quiz\Config\Entity;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\quiz\Entity\QuizQuestionType;
class QuizQuestionListBuilder extends EntityListBuilder {
public function render() {
$build = parent::render();
$build['table']['#caption'] = t('Questions.');
return $build;
}
public function buildHeader() {
$header['title'] = $this
->t('Title');
$header['type'] = $this
->t('Type');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['title'] = $entity
->toLink(NULL, 'edit-form');
$row['type'] = QuizQuestionType::load($entity
->bundle())
->label();
return $row + parent::buildRow($entity);
}
}