class CategoryListController

Provides a listing of contact categories.

Hierarchy

Expanded class hierarchy of CategoryListController

File

drupal/core/modules/contact/lib/Drupal/contact/CategoryListController.php, line 15

Namespace

Drupal\contact
View source
class CategoryListController extends ConfigEntityListController {

  /**
   * Overrides Drupal\Core\Entity\EntityListController::buildHeader().
   */
  public function buildHeader() {
    $row['category'] = t('Category');
    $row['recipients'] = t('Recipients');
    $row['selected'] = t('Selected');
    $row['operations'] = t('Operations');
    return $row;
  }

  /**
   * Overrides Drupal\Core\Entity\EntityListController::buildRow().
   */
  public function buildRow(EntityInterface $entity) {
    $row['category'] = check_plain($entity
      ->label());
    $row['recipients'] = check_plain(implode(', ', $entity->recipients));
    $default_category = config('contact.settings')
      ->get('default_category');
    $row['selected'] = $default_category == $entity
      ->id() ? t('Yes') : t('No');
    $row['operations']['data'] = $this
      ->buildOperations($entity);
    return $row;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CategoryListController::buildHeader public function Overrides Drupal\Core\Entity\EntityListController::buildHeader(). Overrides EntityListController::buildHeader
CategoryListController::buildRow public function Overrides Drupal\Core\Entity\EntityListController::buildRow(). Overrides EntityListController::buildRow
ConfigEntityListController::load public function Overrides Drupal\Core\Entity\EntityListController::load(). Overrides EntityListController::load
EntityListController::$entityInfo protected property The entity info array.
EntityListController::$entityType protected property The entity type name.
EntityListController::$storage protected property The entity storage controller class.
EntityListController::buildOperations public function Builds a renderable list of operation links for the entity. 1
EntityListController::getOperations public function Implements Drupal\Core\Entity\EntityListControllerInterface::getOperations(). Overrides EntityListControllerInterface::getOperations 2
EntityListController::getStorageController public function Implements Drupal\Core\Entity\EntityListControllerInterface::getStorageController(). Overrides EntityListControllerInterface::getStorageController
EntityListController::render public function Implements Drupal\Core\Entity\EntityListControllerInterface::render(). Overrides EntityListControllerInterface::render 1
EntityListController::__construct public function Constructs a new EntityListController object.