class ConfigEntityListController

Defines the default list controller for ConfigEntity objects.

Hierarchy

Expanded class hierarchy of ConfigEntityListController

10 files declare their use of ConfigEntityListController
ActionListController.php in drupal/core/modules/action/lib/Drupal/action/ActionListController.php
Contains \Drupal\action\ActionListController.
BlockListController.php in drupal/core/modules/block/lib/Drupal/block/BlockListController.php
Contains \Drupal\block\BlockListController.
CategoryListController.php in drupal/core/modules/contact/lib/Drupal/contact/CategoryListController.php
CustomBlockTypeListController.php in drupal/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListController.php
Contains \Drupal\custom_block\CustomBlockTypeListController.
MenuListController.php in drupal/core/modules/menu/lib/Drupal/menu/MenuListController.php

... See full list

File

drupal/core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php, line 16
Definition of Drupal\Core\Config\Entity\ConfigEntityListController.

Namespace

Drupal\Core\Config\Entity
View source
class ConfigEntityListController extends EntityListController {

  /**
   * Overrides Drupal\Core\Entity\EntityListController::load().
   */
  public function load() {
    $entities = parent::load();
    uasort($entities, array(
      $this->entityInfo['class'],
      'sort',
    ));
    return $entities;
  }

  /**
   * Overrides \Drupal\Core\Entity\EntityListController::getOperations();
   */
  public function getOperations(EntityInterface $entity) {
    $operations = parent::getOperations($entity);
    $uri = $entity
      ->uri();
    if (isset($this->entityInfo['entity_keys']['status'])) {
      if (!$entity
        ->status()) {
        $operations['enable'] = array(
          'title' => t('Enable'),
          'href' => $uri['path'] . '/enable',
          'options' => $uri['options'],
          'weight' => -10,
        );
      }
      else {
        $operations['disable'] = array(
          'title' => t('Disable'),
          'href' => $uri['path'] . '/disable',
          'options' => $uri['options'],
          'weight' => 20,
        );
      }
    }
    return $operations;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigEntityListController::getOperations public function Overrides \Drupal\Core\Entity\EntityListController::getOperations(); Overrides EntityListController::getOperations 9
ConfigEntityListController::load public function Overrides Drupal\Core\Entity\EntityListController::load(). Overrides EntityListController::load 3
EntityListController::$entityInfo protected property The entity info array.
EntityListController::$entityType protected property The entity type name.
EntityListController::$moduleHandler protected property The module handler to invoke hooks on.
EntityListController::$storage protected property The entity storage controller class.
EntityListController::buildHeader public function Builds the header row for the entity listing. 8
EntityListController::buildOperations public function Builds a renderable list of operation links for the entity. 1
EntityListController::buildRow public function Builds a row for an entity in the entity listing. 8
EntityListController::createInstance public static function Instantiates a new instance of this entity controller. Overrides EntityControllerInterface::createInstance 1
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 6
EntityListController::__construct public function Constructs a new EntityListController object. 1