QuizFeedbackTypeListBuilder.php in Quiz 8.6
File
src/Config/Entity/QuizFeedbackTypeListBuilder.php
View source
<?php
namespace Drupal\quiz\Config\Entity;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Url;
class QuizFeedbackTypeListBuilder extends ConfigEntityListBuilder {
public function render() {
$build = parent::render();
$build['table']['#caption'] = t('Feedback types.');
return $build;
}
public function buildHeader() {
$header['type'] = $this
->t('Feedback time');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['type'] = $entity
->toLink(NULL, 'edit-form');
return $row + parent::buildRow($entity);
}
function getDefaultOperations(EntityInterface $entity) {
$operations = parent::getDefaultOperations($entity);
$operations['conditions'] = [
'title' => $this
->t('Conditions'),
'url' => Url::fromRoute('entity.quiz_feedback_type.conditions', [
'quiz_feedback_type' => $entity
->id(),
]),
'weight' => 50,
];
return $operations;
}
}