CourseEnrollmentTypeListBuilder.php in Course 8.3
File
src/Config/Entity/CourseEnrollmentTypeListBuilder.php
View source
<?php
namespace Drupal\course\Config\Entity;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
class CourseEnrollmentTypeListBuilder extends ConfigEntityListBuilder {
public function render() {
$build = parent::render();
$build['table']['#caption'] = t('Enrollment types can be used to gather information before an enrollment into a course. It is recommended to use one enrollment types across multiple courses instead of creating a new enrollment type for each course.');
return $build;
}
public function buildHeader() {
$header['type'] = $this
->t('Enrollment type');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['type'] = $entity
->toLink(NULL, 'edit-form');
return $row + parent::buildRow($entity);
}
}