OpignoAnswerListBuilder.php in Opigno module 8
File
src/OpignoAnswerListBuilder.php
View source
<?php
namespace Drupal\opigno_module;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\Core\Link;
class OpignoAnswerListBuilder extends EntityListBuilder {
public function buildHeader() {
$header['id'] = $this
->t('Answer ID');
$header['name'] = $this
->t('Name');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['id'] = $entity
->id();
$row['name'] = Link::createFromRoute($entity
->id(), 'entity.opigno_answer.edit_form', [
'opigno_answer' => $entity
->id(),
]);
return $row + parent::buildRow($entity);
}
}