You are here

CourseEnrollmentTypeListBuilder.php in Course 3.x

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;

/**
 * Defines the list builder for profile types.
 */
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;
  }

  /**
   * {@inheritdoc}
   */
  public function buildHeader() {
    $header['type'] = $this
      ->t('Enrollment 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
CourseEnrollmentTypeListBuilder Defines the list builder for profile types.