diff --git a/core/includes/entity.inc b/core/includes/entity.inc index 51b0f79..2859b59 100644 --- a/core/includes/entity.inc +++ b/core/includes/entity.inc @@ -423,25 +423,6 @@ function entity_access_controller($entity_type) { } /** - * Returns an entity list controller for a given entity type. - * - * @param string $entity_type - * The type of the entity. - * - * @return \Drupal\Core\Entity\EntityListControllerInterface - * An entity list controller. - * - * @see \Drupal\Core\Entity\EntityManagerInterface::getListController(). - * - * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0. - * Use \Drupal::entityManager()->getListController(). - */ -function entity_list_controller($entity_type) { - return \Drupal::entityManager() - ->getListController($entity_type); -} - -/** * Returns the render array for an entity. * * @param \Drupal\Core\Entity\EntityInterface $entity diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityListBuilder.php similarity index 77% rename from core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php rename to core/lib/Drupal/Core/Config/Entity/ConfigEntityListBuilder.php index 54afad2..601de73 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityListBuilder.php @@ -2,21 +2,21 @@ /** * @file - * Definition of Drupal\Core\Config\Entity\ConfigEntityListController. + * Contains \Drupal\Core\Config\Entity\ConfigEntityListBuilder. */ namespace Drupal\Core\Config\Entity; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityListController; +use Drupal\Core\Entity\EntityListBuilder; /** - * Defines the default list controller for ConfigEntity objects. + * Defines the default class to build a listing of configuration entities. */ -class ConfigEntityListController extends EntityListController { +class ConfigEntityListBuilder extends EntityListBuilder { /** - * Overrides Drupal\Core\Entity\EntityListController::load(). + * {@inheritdoc} */ public function load() { $entities = parent::load(); diff --git a/core/lib/Drupal/Core/Config/Entity/DraggableListController.php b/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php similarity index 94% rename from core/lib/Drupal/Core/Config/Entity/DraggableListController.php rename to core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php index f2c3ff8..cb68a0e 100644 --- a/core/lib/Drupal/Core/Config/Entity/DraggableListController.php +++ b/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\Core\Config\Entity\DraggableListController. + * Contains \Drupal\Core\Config\Entity\DraggableListBuilder. */ namespace Drupal\Core\Config\Entity; @@ -13,9 +13,9 @@ use Drupal\Core\Form\FormInterface; /** - * Provides a list controller for draggable configuration entities. + * Defines a class to build a draggable listing of configuration entities. */ -abstract class DraggableListController extends ConfigEntityListController implements FormInterface { +abstract class DraggableListBuilder extends ConfigEntityListBuilder implements FormInterface { /** * The key to use for the form element containing the entities. diff --git a/core/lib/Drupal/Core/Entity/Controller/EntityListController.php b/core/lib/Drupal/Core/Entity/Controller/EntityListController.php index 7a07a38..1b081bb 100644 --- a/core/lib/Drupal/Core/Entity/Controller/EntityListController.php +++ b/core/lib/Drupal/Core/Entity/Controller/EntityListController.php @@ -25,7 +25,7 @@ class EntityListController extends ControllerBase { * A render array as expected by drupal_render(). */ public function listing($entity_type) { - return $this->entityManager()->getListController($entity_type)->render(); + return $this->entityManager()->getListBuilder($entity_type)->render(); } } diff --git a/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php b/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php index 31672c0..aac92bc 100644 --- a/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php +++ b/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php @@ -25,7 +25,7 @@ class EntityViewController implements ContainerInjectionInterface { protected $entityManager; /** - * Creates an EntityListController object. + * Creates an EntityViewController object. * * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager * The entity manager. diff --git a/core/lib/Drupal/Core/Entity/EntityListController.php b/core/lib/Drupal/Core/Entity/EntityListBuilder.php similarity index 85% rename from core/lib/Drupal/Core/Entity/EntityListController.php rename to core/lib/Drupal/Core/Entity/EntityListBuilder.php index c6585be..626c275 100644 --- a/core/lib/Drupal/Core/Entity/EntityListController.php +++ b/core/lib/Drupal/Core/Entity/EntityListBuilder.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\Core\Entity\EntityListController. + * Contains \Drupal\Core\Entity\EntityListBuilder. */ namespace Drupal\Core\Entity; @@ -13,9 +13,9 @@ use Drupal\Component\Utility\String; /** - * Provides a generic implementation of an entity list controller. + * Defines a generic implementation to build a listing of entities. */ -class EntityListController extends EntityControllerBase implements EntityListControllerInterface, EntityControllerInterface { +class EntityListBuilder extends EntityControllerBase implements EntityListBuilderInterface, EntityControllerInterface { /** * The entity storage controller class. @@ -49,7 +49,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI } /** - * Constructs a new EntityListController object. + * Constructs a new EntityListBuilder object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. @@ -63,14 +63,14 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageContr } /** - * Implements \Drupal\Core\Entity\EntityListControllerInterface::getStorageController(). + * {@inheritdoc} */ public function getStorageController() { return $this->storage; } /** - * Implements \Drupal\Core\Entity\EntityListControllerInterface::load(). + * {@inheritdoc} */ public function load() { return $this->storage->loadMultiple(); @@ -116,7 +116,7 @@ public function getOperations(EntityInterface $entity) { * @return array * A render array structure of header strings. * - * @see \Drupal\Core\Entity\EntityListController::render() + * @see \Drupal\Core\Entity\EntityListBuilder::render() */ public function buildHeader() { $row['operations'] = $this->t('Operations'); @@ -132,7 +132,7 @@ public function buildHeader() { * @return array * A render array structure of fields for this entity. * - * @see \Drupal\Core\Entity\EntityListController::render() + * @see \Drupal\Core\Entity\EntityListBuilder::render() */ public function buildRow(EntityInterface $entity) { $row['operations']['data'] = $this->buildOperations($entity); @@ -148,7 +148,7 @@ public function buildRow(EntityInterface $entity) { * @return array * A renderable array of operation links. * - * @see \Drupal\Core\Entity\EntityListController::render() + * @see \Drupal\Core\Entity\EntityListBuilder::buildRow() */ public function buildOperations(EntityInterface $entity) { // Retrieve and sort operations. @@ -163,9 +163,9 @@ public function buildOperations(EntityInterface $entity) { } /** - * Implements \Drupal\Core\Entity\EntityListControllerInterface::render(). + * {@inheritdoc} * - * Builds the entity list as renderable array for theme_table(). + * Builds the entity listing as renderable array for theme_table(). * * @todo Add a link to add a new item to the #empty text. */ @@ -199,7 +199,6 @@ protected function t($string, array $args = array(), array $options = array()) { * * @return string * A string title of the page. - * */ protected function getTitle() { return; diff --git a/core/lib/Drupal/Core/Entity/EntityListControllerInterface.php b/core/lib/Drupal/Core/Entity/EntityListBuilderInterface.php similarity index 68% rename from core/lib/Drupal/Core/Entity/EntityListControllerInterface.php rename to core/lib/Drupal/Core/Entity/EntityListBuilderInterface.php index 775445e..99f5935 100644 --- a/core/lib/Drupal/Core/Entity/EntityListControllerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityListBuilderInterface.php @@ -2,32 +2,32 @@ /** * @file - * Contains \Drupal\Core\Entity\EntityListControllerInterface. + * Contains \Drupal\Core\Entity\EntityListBuilderInterface. */ namespace Drupal\Core\Entity; /** - * Defines an interface for entity list controllers. + * Defines an interface to build entity listings. */ -interface EntityListControllerInterface { +interface EntityListBuilderInterface { /** * Gets the entity storage controller. * * @return \Drupal\Core\Entity\EntityStorageControllerInterface - * The storage controller used by this list controller. + * The storage controller used by this list builder. */ public function getStorageController(); /** * Loads entities of this type from storage for listing. * - * This allows the controller to manipulate the list, like filtering or + * This allows the implementation to manipulate the listing, like filtering or * sorting the loaded entities. * * @return \Drupal\Core\Entity\EntityInterface[] - * An array of entities implementing Drupal\Core\Entity\EntityInterface. + * An array of entities implementing \Drupal\Core\Entity\EntityInterface. */ public function load(); @@ -48,10 +48,10 @@ public function load(); public function getOperations(EntityInterface $entity); /** - * Renders the list page markup to be output. + * Returns a listing of entities for the given entity type. * - * @return string - * The output markup for the listing page. + * @return array + * A render array as expected by drupal_render(). */ public function render(); diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index c7c111c..00c9d73 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -191,8 +191,8 @@ public function getStorageController($entity_type) { /** * {@inheritdoc} */ - public function getListController($entity_type) { - return $this->getController($entity_type, 'list', 'getListClass'); + public function getListBuilder($entity_type) { + return $this->getController($entity_type, 'list_builder', 'getListBuilderClass'); } /** diff --git a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php index e40ff94..9a65866 100644 --- a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php @@ -119,15 +119,15 @@ public function clearCachedDefinitions(); public function getViewBuilder($entity_type); /** - * Creates a new list controller instance. + * Creates a new entity list builder. * * @param string $entity_type - * The entity type for this list controller. + * The entity type for this list builder. * - * @return \Drupal\Core\Entity\EntityListControllerInterface - * A list controller instance. + * @return \Drupal\Core\Entity\EntityListBuilderInterface + * An entity list builder instance. */ - public function getListController($entity_type); + public function getListBuilder($entity_type); /** * Creates a new form controller instance. diff --git a/core/lib/Drupal/Core/Entity/EntityType.php b/core/lib/Drupal/Core/Entity/EntityType.php index 4eae0df..93f6062 100644 --- a/core/lib/Drupal/Core/Entity/EntityType.php +++ b/core/lib/Drupal/Core/Entity/EntityType.php @@ -365,23 +365,23 @@ public function hasFormClasses() { /** * {@inheritdoc} */ - public function getListClass() { - return $this->getControllerClass('list'); + public function getListBuilderClass() { + return $this->getControllerClass('list_builder'); } /** * {@inheritdoc} */ - public function setListClass($class) { - $this->controllers['list'] = $class; + public function setListBuilderClass($class) { + $this->controllers['list_builder'] = $class; return $this; } /** * {@inheritdoc} */ - public function hasListClass() { - return $this->hasControllerClass('list'); + public function hasListBuilderClass() { + return $this->hasControllerClass('list_builder'); } /** diff --git a/core/lib/Drupal/Core/Entity/EntityTypeInterface.php b/core/lib/Drupal/Core/Entity/EntityTypeInterface.php index 226dc91..5934322 100644 --- a/core/lib/Drupal/Core/Entity/EntityTypeInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityTypeInterface.php @@ -194,7 +194,7 @@ public function getControllerClass($controller_type); * entity forms when the forms are similar. The classes must implement * \Drupal\Core\Entity\EntityFormControllerInterface. * - list: The name of the class that provides listings of the entities. The - * class must implement \Drupal\Core\Entity\EntityListControllerInterface. + * class must implement \Drupal\Core\Entity\EntityListBuilderInterface. * - render: The name of the class that is used to render the entities. The * class must implement \Drupal\Core\Entity\EntityViewBuilderInterface. * - access: The name of the class that is used for access checks. The class @@ -263,7 +263,7 @@ public function hasFormClasses(); * @return string * The class for this entity type's list. */ - public function getListClass(); + public function getListBuilderClass(); /** * Sets the list class. @@ -273,7 +273,7 @@ public function getListClass(); * * @return static */ - public function setListClass($class); + public function setListBuilderClass($class); /** * Indicates if this entity type has a list class. @@ -281,7 +281,7 @@ public function setListClass($class); * @return bool * TRUE if there is a list for this entity type, FALSE otherwise. */ - public function hasListClass(); + public function hasListBuilderClass(); /** * Returns the view builder class. diff --git a/core/modules/action/action.module b/core/modules/action/action.module index ee2f628..e765a24 100644 --- a/core/modules/action/action.module +++ b/core/modules/action/action.module @@ -67,7 +67,7 @@ function action_entity_type_build(array &$entity_types) { ->setFormClass('add', 'Drupal\action\ActionAddFormController') ->setFormClass('edit', 'Drupal\action\ActionEditFormController') ->setFormClass('delete', 'Drupal\action\Form\ActionDeleteForm') - ->setListClass('Drupal\action\ActionListController') + ->setListBuilderClass('Drupal\action\ActionListBuilder') ->setLinkTemplate('delete-form', 'action.delete') ->setLinkTemplate('edit-form', 'action.admin_configure'); } diff --git a/core/modules/action/lib/Drupal/action/ActionListController.php b/core/modules/action/lib/Drupal/action/ActionListBuilder.php similarity index 89% rename from core/modules/action/lib/Drupal/action/ActionListController.php rename to core/modules/action/lib/Drupal/action/ActionListBuilder.php index 946bcca..7ef6e19 100644 --- a/core/modules/action/lib/Drupal/action/ActionListController.php +++ b/core/modules/action/lib/Drupal/action/ActionListBuilder.php @@ -2,23 +2,25 @@ /** * @file - * Contains \Drupal\action\ActionListController. + * Contains \Drupal\action\ActionListBuilder. */ namespace Drupal\action; use Drupal\Core\Action\ActionManager; -use Drupal\Core\Entity\EntityControllerInterface; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Config\Entity\ConfigEntityListController; +use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Entity\EntityTypeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Provides a listing of Actions. + * Defines a class to build a listing of action entities. + * + * @see \Drupal\system\Entity\Action + * @see action_entity_info() */ -class ActionListController extends ConfigEntityListController implements EntityControllerInterface { +class ActionListBuilder extends ConfigEntityListBuilder { /** * @var bool @@ -33,7 +35,7 @@ class ActionListController extends ConfigEntityListController implements EntityC protected $actionManager; /** - * Constructs a new ActionListController object. + * Constructs a new ActionListBuilder object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockListController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockListBuilder.php similarity index 73% rename from core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockListController.php rename to core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockListBuilder.php index 1f49a87..94c9e31 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockListController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockListBuilder.php @@ -2,18 +2,20 @@ /** * @file - * Contains \Drupal\custom_block\CustomBlockListController. + * Contains \Drupal\custom_block\CustomBlockListBuilder. */ namespace Drupal\custom_block; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityListController; +use Drupal\Core\Entity\EntityListBuilder; /** - * Provides a listing of custom block entities. + * Defines a class to build a listing of custom block entities. + * + * @see \Drupal\custom_block\Entity\CustomBlock */ -class CustomBlockListController extends EntityListController { +class CustomBlockListBuilder extends EntityListBuilder { /** * {@inheritdoc} diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListBuilder.php similarity index 74% rename from core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListController.php rename to core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListBuilder.php index 84a8ad9..901ef6f 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListBuilder.php @@ -2,18 +2,20 @@ /** * @file - * Contains \Drupal\custom_block\CustomBlockTypeListController. + * Contains \Drupal\custom_block\CustomBlockTypeListBuilder. */ namespace Drupal\custom_block; -use Drupal\Core\Config\Entity\ConfigEntityListController; +use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Entity\EntityInterface; /** - * Provides a listing of custom block types. + * Defines a class to build a listing of custom block type entities. + * + * @see \Drupal\custom_block\Entity\CustomBlockType */ -class CustomBlockTypeListController extends ConfigEntityListController { +class CustomBlockTypeListBuilder extends ConfigEntityListBuilder { /** * {@inheritdoc} @@ -29,7 +31,7 @@ public function getOperations(EntityInterface $entity) { } /** - * Overrides \Drupal\Core\Entity\EntityListController::buildHeader(). + * {@inheritdoc} */ public function buildHeader() { $header['type'] = t('Block type'); @@ -38,7 +40,7 @@ public function buildHeader() { } /** - * Overrides \Drupal\Core\Entity\EntityListController::buildRow(). + * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { $uri = $entity->urlInfo(); diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php index 88d232b..ea20a79 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php @@ -22,7 +22,7 @@ * bundle_label = @Translation("Custom Block type"), * controllers = { * "access" = "Drupal\custom_block\CustomBlockAccessController", - * "list" = "Drupal\custom_block\CustomBlockListController", + * "list_builder" = "Drupal\custom_block\CustomBlockListBuilder", * "view_builder" = "Drupal\custom_block\CustomBlockViewBuilder", * "form" = { * "add" = "Drupal\custom_block\CustomBlockFormController", diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php index 59a4735..57ed007 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php @@ -24,7 +24,7 @@ * "edit" = "Drupal\custom_block\CustomBlockTypeFormController", * "delete" = "Drupal\custom_block\Form\CustomBlockTypeDeleteForm" * }, - * "list" = "Drupal\custom_block\CustomBlockTypeListController" + * "list_builder" = "Drupal\custom_block\CustomBlockTypeListBuilder" * }, * admin_permission = "administer blocks", * config_prefix = "type", diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php index 3678a23..fa7cc8f 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php @@ -12,7 +12,7 @@ /** * Tests the listing of custom blocks. * - * @see \Drupal\block\CustomBlockListController + * @see \Drupal\block\CustomBlockListBuilder */ class CustomBlockListTest extends WebTestBase { diff --git a/core/modules/block/lib/Drupal/block/BlockListController.php b/core/modules/block/lib/Drupal/block/BlockListBuilder.php similarity index 95% rename from core/modules/block/lib/Drupal/block/BlockListController.php rename to core/modules/block/lib/Drupal/block/BlockListBuilder.php index 65db261..31b3286 100644 --- a/core/modules/block/lib/Drupal/block/BlockListController.php +++ b/core/modules/block/lib/Drupal/block/BlockListBuilder.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\block\BlockListController. + * Contains \Drupal\block\BlockListBuilder. */ namespace Drupal\block; @@ -11,20 +11,20 @@ use Drupal\Component\Utility\Json; use Drupal\Component\Utility\String; use Drupal\Core\Cache\Cache; -use Drupal\Core\Config\Entity\ConfigEntityListController; -use Drupal\Core\Entity\EntityControllerInterface; +use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Entity\EntityTypeInterface; -use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; /** - * Defines the block list controller. + * Defines a class to build a listing of block entities. + * + * @see \Drupal\block\Entity\Block */ -class BlockListController extends ConfigEntityListController implements FormInterface, EntityControllerInterface { +class BlockListBuilder extends ConfigEntityListBuilder implements FormInterface { /** * The regions containing the blocks. @@ -55,7 +55,7 @@ class BlockListController extends ConfigEntityListController implements FormInte protected $blockManager; /** - * Constructs a new BlockListController object. + * Constructs a new BlockListBuilder object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. @@ -82,7 +82,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI } /** - * Overrides \Drupal\Core\Config\Entity\ConfigEntityListController::load(). + * {@inheritdoc} */ public function load() { // If no theme was specified, use the current theme. @@ -103,7 +103,7 @@ public function load() { } /** - * Overrides \Drupal\Core\Entity\EntityListController::render(). + * {@inheritdoc} * * @param string|null $theme * (optional) The theme to display the blocks for. If NULL, the current diff --git a/core/modules/block/lib/Drupal/block/Controller/BlockListController.php b/core/modules/block/lib/Drupal/block/Controller/BlockListController.php index 2852970..72aa445 100644 --- a/core/modules/block/lib/Drupal/block/Controller/BlockListController.php +++ b/core/modules/block/lib/Drupal/block/Controller/BlockListController.php @@ -8,7 +8,6 @@ namespace Drupal\block\Controller; use Drupal\Core\Entity\Controller\EntityListController; -use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; /** @@ -29,7 +28,7 @@ class BlockListController extends EntityListController { */ public function listing($theme = NULL, Request $request = NULL) { $theme = $theme ?: $this->config('system.theme')->get('default'); - return $this->entityManager()->getListController('block')->render($theme, $request); + return $this->entityManager()->getListBuilder('block')->render($theme, $request); } } diff --git a/core/modules/block/lib/Drupal/block/Entity/Block.php b/core/modules/block/lib/Drupal/block/Entity/Block.php index cb49cac..39e52be 100644 --- a/core/modules/block/lib/Drupal/block/Entity/Block.php +++ b/core/modules/block/lib/Drupal/block/Entity/Block.php @@ -21,7 +21,7 @@ * controllers = { * "access" = "Drupal\block\BlockAccessController", * "view_builder" = "Drupal\block\BlockViewBuilder", - * "list" = "Drupal\block\BlockListController", + * "list_builder" = "Drupal\block\BlockListBuilder", * "form" = { * "default" = "Drupal\block\BlockFormController", * "delete" = "Drupal\block\Form\BlockDeleteForm" diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php index 682aeef..710cc0d 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php @@ -32,10 +32,10 @@ public static function getInfo() { } /** - * Tests entity list controller methods. + * Tests entity list builder methods. */ function testList() { - $controller = \Drupal::entityManager()->getListController('config_test'); + $controller = \Drupal::entityManager()->getListBuilder('config_test'); // Test getStorageController() method. $this->assertTrue($controller->getStorageController() instanceof EntityStorageControllerInterface, 'EntityStorageController instance in storage.'); @@ -116,7 +116,7 @@ function testList() { // Test that config entities that do not support status, do not have // enable/disable operations. $controller = $this->container->get('entity.manager') - ->getListController('config_test_no_status'); + ->getListBuilder('config_test_no_status'); $list = $controller->load(); $entity = $list['default']; diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestListController.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestListBuilder.php similarity index 64% rename from core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestListController.php rename to core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestListBuilder.php index 564876a..8634b96 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestListController.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestListBuilder.php @@ -2,18 +2,20 @@ /** * @file - * Contains \Drupal\config_test\ConfigTestListController. + * Contains \Drupal\config_test\ConfigTestListBuilder. */ namespace Drupal\config_test; -use Drupal\Core\Config\Entity\ConfigEntityListController; +use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Entity\EntityInterface; /** - * Provides a list controller for config_test. + * Defines a class to build a listing of ConfigTest entities. + * + * @see \Drupal\config_test\Entity\ConfigTest */ -class ConfigTestListController extends ConfigEntityListController { +class ConfigTestListBuilder extends ConfigEntityListBuilder { /** * {@inheritdoc} diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigQueryTest.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigQueryTest.php index c3528f9..53cd76d 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigQueryTest.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigQueryTest.php @@ -15,7 +15,7 @@ * label = @Translation("Test configuration for query"), * controllers = { * "storage" = "Drupal\config_test\ConfigTestStorageController", - * "list" = "Drupal\Core\Config\Entity\ConfigEntityListController", + * "list_builder" = "Drupal\Core\Config\Entity\ConfigEntityListBuilder", * "form" = { * "default" = "Drupal\config_test\ConfigTestFormController" * } diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php index 029a7ac..12a055a 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php @@ -18,7 +18,7 @@ * label = @Translation("Test configuration"), * controllers = { * "storage" = "Drupal\config_test\ConfigTestStorageController", - * "list" = "Drupal\config_test\ConfigTestListController", + * "list_builder" = "Drupal\config_test\ConfigTestListBuilder", * "form" = { * "default" = "Drupal\config_test\ConfigTestFormController", * "delete" = "Drupal\config_test\Form\ConfigTestDeleteForm" diff --git a/core/modules/config_translation/config_translation.module b/core/modules/config_translation/config_translation.module index 2204689..e500b9d 100644 --- a/core/modules/config_translation/config_translation.module +++ b/core/modules/config_translation/config_translation.module @@ -78,15 +78,15 @@ function config_translation_entity_type_alter(array &$entity_types) { foreach ($entity_types as $entity_type_id => $entity_type) { if ($entity_type->isSubclassOf('Drupal\Core\Config\Entity\ConfigEntityInterface')) { if ($entity_type_id == 'block') { - $class = 'Drupal\config_translation\Controller\ConfigTranslationBlockListController'; + $class = 'Drupal\config_translation\Controller\ConfigTranslationBlockListBuilder'; } elseif ($entity_type_id == 'field_instance_config') { - $class = 'Drupal\config_translation\Controller\ConfigTranslationFieldInstanceListController'; + $class = 'Drupal\config_translation\Controller\ConfigTranslationFieldInstanceListBuilder'; // Will be filled in dynamically, see \Drupal\field\Entity\FieldInstanceConfig::linkTemplates(). $entity_type->setLinkTemplate('drupal:config-translation-overview', 'config_translation.item.overview.'); } else { - $class = 'Drupal\config_translation\Controller\ConfigTranslationEntityListController'; + $class = 'Drupal\config_translation\Controller\ConfigTranslationEntityListBuilder'; } $entity_type->setControllerClass('config_translation_list', $class); diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationBlockListController.php b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationBlockListBuilder.php similarity index 93% rename from core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationBlockListController.php rename to core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationBlockListBuilder.php index c69dcde..90d61bb 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationBlockListController.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationBlockListBuilder.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\config_translation\Controller\ConfigTranslationBlockListController. + * Contains \Drupal\config_translation\Controller\ConfigTranslationBlockListBuilder. */ namespace Drupal\config_translation\Controller; @@ -15,9 +15,9 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Defines the config translation controller for blocks. + * Defines the config translation list builder for blocks. */ -class ConfigTranslationBlockListController extends ConfigTranslationEntityListController { +class ConfigTranslationBlockListBuilder extends ConfigTranslationEntityListBuilder { /** * An array of theme info keyed by theme name. diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationEntityListController.php b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationEntityListBuilder.php similarity index 92% rename from core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationEntityListController.php rename to core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationEntityListBuilder.php index c8c495b..44f5aad 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationEntityListController.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationEntityListBuilder.php @@ -2,18 +2,18 @@ /** * @file - * Contains \Drupal\config_translation\Controller\ConfigTranslationEntityListController. + * Contains \Drupal\config_translation\Controller\ConfigTranslationEntityListBuilder. */ namespace Drupal\config_translation\Controller; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityListController; +use Drupal\Core\Entity\EntityListBuilder; /** - * Defines the configuration translation controller for entities. + * Defines the configuration translation list builder for entities. */ -class ConfigTranslationEntityListController extends EntityListController implements ConfigTranslationEntityListControllerInterface { +class ConfigTranslationEntityListBuilder extends EntityListBuilder implements ConfigTranslationEntityListBuilderInterface { /** * Provides user facing strings for the filter element. diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationEntityListControllerInterface.php b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationEntityListBuilderInterface.php similarity index 78% rename from core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationEntityListControllerInterface.php rename to core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationEntityListBuilderInterface.php index f2340b3..08791c8 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationEntityListControllerInterface.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationEntityListBuilderInterface.php @@ -2,17 +2,17 @@ /** * @file - * Contains \Drupal\config_translation\Controller\ConfigTranslationEntityListControllerInterface. + * Contains \Drupal\config_translation\Controller\ConfigTranslationEntityListBuilderInterface. */ namespace Drupal\config_translation\Controller; -use Drupal\Core\Entity\EntityListControllerInterface; +use Drupal\Core\Entity\EntityListBuilderInterface; /** - * Defines an interface for configuration translation entity list controllers. + * Defines an interface for configuration translation entity list builders. */ -interface ConfigTranslationEntityListControllerInterface extends EntityListControllerInterface { +interface ConfigTranslationEntityListBuilderInterface extends EntityListBuilderInterface { /** * Sorts an array by value. diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationFieldInstanceListController.php b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationFieldInstanceListBuilder.php similarity index 94% rename from core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationFieldInstanceListController.php rename to core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationFieldInstanceListBuilder.php index 760b8cb..c2372d9 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationFieldInstanceListController.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationFieldInstanceListBuilder.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\config_translation\Controller\ConfigTranslationFieldInstanceListController. + * Contains \Drupal\config_translation\Controller\ConfigTranslationFieldInstanceListBuilder. */ namespace Drupal\config_translation\Controller; @@ -17,9 +17,9 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Defines the config translation controller for field instance entities. + * Defines the config translation list builder for field instance entities. */ -class ConfigTranslationFieldInstanceListController extends ConfigTranslationEntityListController { +class ConfigTranslationFieldInstanceListBuilder extends ConfigTranslationEntityListBuilder { /** * The name of the entity type the field instances are attached to. @@ -62,7 +62,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI } /** - * Constructs a new ConfigTranslationFieldInstanceListController object. + * Constructs a new ConfigTranslationFieldInstanceListBuilder object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationMapperList.php b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationMapperList.php index 14f9724..23007e9 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationMapperList.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationMapperList.php @@ -120,7 +120,7 @@ public function buildHeader() { * @return array * A renderable array of operation links. * - * @see \Drupal\Core\Entity\EntityListController::buildOperations() + * @see \Drupal\Core\Entity\EntityList::buildOperations() */ protected function buildOperations(ConfigMapperInterface $mapper) { // Retrieve and sort operations. diff --git a/core/modules/contact/lib/Drupal/contact/CategoryListController.php b/core/modules/contact/lib/Drupal/contact/CategoryListBuilder.php similarity index 72% rename from core/modules/contact/lib/Drupal/contact/CategoryListController.php rename to core/modules/contact/lib/Drupal/contact/CategoryListBuilder.php index e68789b..37169ff 100644 --- a/core/modules/contact/lib/Drupal/contact/CategoryListController.php +++ b/core/modules/contact/lib/Drupal/contact/CategoryListBuilder.php @@ -1,22 +1,25 @@ getLabel($entity); diff --git a/core/modules/contact/lib/Drupal/contact/Entity/Category.php b/core/modules/contact/lib/Drupal/contact/Entity/Category.php index a2fe218..0fc1d7d 100644 --- a/core/modules/contact/lib/Drupal/contact/Entity/Category.php +++ b/core/modules/contact/lib/Drupal/contact/Entity/Category.php @@ -19,7 +19,7 @@ * label = @Translation("Contact category"), * controllers = { * "access" = "Drupal\contact\CategoryAccessController", - * "list" = "Drupal\contact\CategoryListController", + * "list_builder" = "Drupal\contact\CategoryListBuilder", * "form" = { * "add" = "Drupal\contact\CategoryFormController", * "edit" = "Drupal\contact\CategoryFormController", diff --git a/core/modules/entity/lib/Drupal/entity/Entity/EntityFormMode.php b/core/modules/entity/lib/Drupal/entity/Entity/EntityFormMode.php index 4b57139..4e58485 100644 --- a/core/modules/entity/lib/Drupal/entity/Entity/EntityFormMode.php +++ b/core/modules/entity/lib/Drupal/entity/Entity/EntityFormMode.php @@ -32,7 +32,7 @@ * label = @Translation("Form mode"), * controllers = { * "storage" = "Drupal\entity\EntityDisplayModeStorageController", - * "list" = "Drupal\entity\EntityFormModeListController", + * "list_builder" = "Drupal\entity\EntityFormModeListBuilder", * "form" = { * "add" = "Drupal\entity\Form\EntityFormModeAddForm", * "edit" = "Drupal\entity\Form\EntityDisplayModeEditForm", diff --git a/core/modules/entity/lib/Drupal/entity/Entity/EntityViewMode.php b/core/modules/entity/lib/Drupal/entity/Entity/EntityViewMode.php index 2d98442..df31790 100644 --- a/core/modules/entity/lib/Drupal/entity/Entity/EntityViewMode.php +++ b/core/modules/entity/lib/Drupal/entity/Entity/EntityViewMode.php @@ -32,7 +32,7 @@ * id = "view_mode", * label = @Translation("View mode"), * controllers = { - * "list" = "Drupal\entity\EntityDisplayModeListController", + * "list_builder" = "Drupal\entity\EntityDisplayModeListBuilder", * "form" = { * "add" = "Drupal\entity\Form\EntityDisplayModeAddForm", * "edit" = "Drupal\entity\Form\EntityDisplayModeEditForm", diff --git a/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListController.php b/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListBuilder.php similarity index 91% rename from core/modules/entity/lib/Drupal/entity/EntityDisplayModeListController.php rename to core/modules/entity/lib/Drupal/entity/EntityDisplayModeListBuilder.php index 3e244b3..67f4a2d 100644 --- a/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListController.php +++ b/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListBuilder.php @@ -2,21 +2,23 @@ /** * @file - * Contains \Drupal\entity\EntityDisplayModeListController. + * Contains \Drupal\entity\EntityDisplayModeListBuilder. */ namespace Drupal\entity; -use Drupal\Core\Config\Entity\ConfigEntityListController; +use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Entity\EntityTypeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Provides the listing for entity display modes. + * Defines a class to build a listing of view mode entities. + * + * @see \Drupal\entity\Entity\EntityViewMode */ -class EntityDisplayModeListController extends ConfigEntityListController { +class EntityDisplayModeListBuilder extends ConfigEntityListBuilder { /** * All entity types. @@ -26,7 +28,7 @@ class EntityDisplayModeListController extends ConfigEntityListController { protected $entityTypes; /** - * Constructs a new EntityListController object. + * Constructs a new EntityDisplayModeListBuilder object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. diff --git a/core/modules/entity/lib/Drupal/entity/EntityFormModeListController.php b/core/modules/entity/lib/Drupal/entity/EntityFormModeListBuilder.php similarity index 64% rename from core/modules/entity/lib/Drupal/entity/EntityFormModeListController.php rename to core/modules/entity/lib/Drupal/entity/EntityFormModeListBuilder.php index 04bc923..7c556ab 100644 --- a/core/modules/entity/lib/Drupal/entity/EntityFormModeListController.php +++ b/core/modules/entity/lib/Drupal/entity/EntityFormModeListBuilder.php @@ -2,15 +2,17 @@ /** * @file - * Contains \Drupal\entity\EntityFormModeListController. + * Contains \Drupal\entity\EntityFormModeListBuilder. */ namespace Drupal\entity; /** - * Provides the listing for entity display modes. + * Defines a class to build a listing of form mode entities. + * + * @see \Drupal\entity\Entity\EntityFormMode */ -class EntityFormModeListController extends EntityDisplayModeListController { +class EntityFormModeListBuilder extends EntityDisplayModeListBuilder { /** * Filters entities based on their controllers. diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module index a08593a..5e218f2 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -121,7 +121,7 @@ function field_ui_element_info() { function field_ui_entity_type_build(array &$entity_types) { /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */ $entity_types['field_instance_config']->setFormClass('delete', 'Drupal\field_ui\Form\FieldInstanceConfigDeleteForm'); - $entity_types['field_config']->setListClass('Drupal\field_ui\FieldConfigListController'); + $entity_types['field_config']->setListBuilderClass('Drupal\field_ui\FieldConfigListBuilder'); foreach ($entity_types as $entity_type) { if ($bundle = $entity_type->getBundleOf()) { diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FieldConfigListController.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldConfigListBuilder.php similarity index 90% rename from core/modules/field_ui/lib/Drupal/field_ui/FieldConfigListController.php rename to core/modules/field_ui/lib/Drupal/field_ui/FieldConfigListBuilder.php index 2b473ae..d6dfa49 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/FieldConfigListController.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldConfigListBuilder.php @@ -2,12 +2,12 @@ /** * @file - * Contains \Drupal\field_ui\FieldConfigListController. + * Contains \Drupal\field_ui\FieldConfigListBuilder. */ namespace Drupal\field_ui; -use Drupal\Core\Config\Entity\ConfigEntityListController; +use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\EntityTypeInterface; @@ -15,9 +15,12 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Provides a listing of fields. + * Defines a class to build a listing of fields. + * + * @see \Drupal\field\Entity\Field + * @see field_ui_entity_info() */ -class FieldConfigListController extends ConfigEntityListController { +class FieldConfigListBuilder extends ConfigEntityListBuilder { /** * An array of information about field types. @@ -48,7 +51,7 @@ class FieldConfigListController extends ConfigEntityListController { protected $fieldTypeManager; /** - * Constructs a new FieldConfigListController object. + * Constructs a new FieldConfigListBuilder object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. diff --git a/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php b/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php index 4e6febf..305ca25 100644 --- a/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php +++ b/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php @@ -27,7 +27,7 @@ * "edit" = "Drupal\filter\FilterFormatEditFormController", * "disable" = "Drupal\filter\Form\FilterDisableForm" * }, - * "list" = "Drupal\filter\FilterFormatListController", + * "list_builder" = "Drupal\filter\FilterFormatListBuilder", * "access" = "Drupal\filter\FilterFormatAccessController", * }, * config_prefix = "format", diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php b/core/modules/filter/lib/Drupal/filter/FilterFormatListBuilder.php similarity index 91% rename from core/modules/filter/lib/Drupal/filter/FilterFormatListController.php rename to core/modules/filter/lib/Drupal/filter/FilterFormatListBuilder.php index e64dce8..7ba51af 100644 --- a/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatListBuilder.php @@ -2,24 +2,25 @@ /** * @file - * Contains \Drupal\filter\FilterFormatListController. + * Contains \Drupal\filter\FilterFormatListBuilder. */ namespace Drupal\filter; use Drupal\Component\Utility\String; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\Config\Entity\DraggableListController; -use Drupal\Core\Entity\EntityControllerInterface; +use Drupal\Core\Config\Entity\DraggableListBuilder; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Entity\EntityTypeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Defines the filter format list controller. + * Defines a class to build a listing of filter format entities. + * + * @see \Drupal\filter\Entity\FilterFormat */ -class FilterFormatListController extends DraggableListController implements EntityControllerInterface { +class FilterFormatListBuilder extends DraggableListBuilder { /** * {@inheritdoc} @@ -34,7 +35,7 @@ class FilterFormatListController extends DraggableListController implements Enti protected $configFactory; /** - * Constructs a new FilterFormatListController. + * Constructs a new FilterFormatListBuilder. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. diff --git a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php index 1b3c8db..8b2bcba 100644 --- a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php +++ b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php @@ -30,7 +30,7 @@ * "delete" = "Drupal\image\Form\ImageStyleDeleteForm", * "flush" = "Drupal\image\Form\ImageStyleFlushForm" * }, - * "list" = "Drupal\image\ImageStyleListController", + * "list_builder" = "Drupal\image\ImageStyleListBuilder", * }, * admin_permission = "administer image styles", * config_prefix = "style", diff --git a/core/modules/image/lib/Drupal/image/ImageStyleListController.php b/core/modules/image/lib/Drupal/image/ImageStyleListBuilder.php similarity index 84% rename from core/modules/image/lib/Drupal/image/ImageStyleListController.php rename to core/modules/image/lib/Drupal/image/ImageStyleListBuilder.php index 8d9de4d..e6eac9e 100644 --- a/core/modules/image/lib/Drupal/image/ImageStyleListController.php +++ b/core/modules/image/lib/Drupal/image/ImageStyleListBuilder.php @@ -2,24 +2,24 @@ /** * @file - * Contains \Drupal\image\ImageStyleListController. + * Contains \Drupal\image\ImageStyleListBuilder. */ namespace Drupal\image; -use Drupal\Core\Config\Entity\ConfigEntityListController; -use Drupal\Core\Entity\EntityControllerInterface; +use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Routing\UrlGeneratorInterface; -use Drupal\Core\StringTranslation\Translator\TranslatorInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Provides a listing of image styles. + * Defines a class to build a listing of image style entities. + * + * @see \Drupal\image\Entity\ImageStyle */ -class ImageStyleListController extends ConfigEntityListController implements EntityControllerInterface { +class ImageStyleListBuilder extends ConfigEntityListBuilder { /** * The URL generator. @@ -29,7 +29,7 @@ class ImageStyleListController extends ConfigEntityListController implements Ent protected $urlGenerator; /** - * Constructs a new ImageStyleListController object. + * Constructs a new ImageStyleListBuilder object. * * @param EntityTypeInterface $entity_type * The entity type definition. diff --git a/core/modules/language/lib/Drupal/language/Entity/Language.php b/core/modules/language/lib/Drupal/language/Entity/Language.php index c7ad236..e692ee1 100644 --- a/core/modules/language/lib/Drupal/language/Entity/Language.php +++ b/core/modules/language/lib/Drupal/language/Entity/Language.php @@ -19,7 +19,7 @@ * id = "language_entity", * label = @Translation("Language"), * controllers = { - * "list" = "Drupal\language\LanguageListController", + * "list_builder" = "Drupal\language\LanguageListBuilder", * "access" = "Drupal\language\LanguageAccessController", * "form" = { * "add" = "Drupal\language\Form\LanguageAddForm", diff --git a/core/modules/language/lib/Drupal/language/LanguageListController.php b/core/modules/language/lib/Drupal/language/LanguageListBuilder.php similarity index 88% rename from core/modules/language/lib/Drupal/language/LanguageListController.php rename to core/modules/language/lib/Drupal/language/LanguageListBuilder.php index da1454f..99fb967 100644 --- a/core/modules/language/lib/Drupal/language/LanguageListController.php +++ b/core/modules/language/lib/Drupal/language/LanguageListBuilder.php @@ -1,18 +1,21 @@ setFormClass('add', 'Drupal\menu\MenuFormController') ->setFormClass('edit', 'Drupal\menu\MenuFormController') ->setFormClass('delete', 'Drupal\menu\Form\MenuDeleteForm') - ->setListClass('Drupal\menu\MenuListController') + ->setListBuilderClass('Drupal\menu\MenuListBuilder') ->setLinkTemplate('add-form', 'menu.link_add') ->setLinkTemplate('delete-form', 'menu.delete_menu') ->setLinkTemplate('edit-form', 'menu.menu_edit'); diff --git a/core/modules/node/lib/Drupal/node/Entity/Node.php b/core/modules/node/lib/Drupal/node/Entity/Node.php index a80577c..da4b174 100644 --- a/core/modules/node/lib/Drupal/node/Entity/Node.php +++ b/core/modules/node/lib/Drupal/node/Entity/Node.php @@ -31,7 +31,7 @@ * "delete" = "Drupal\node\Form\NodeDeleteForm", * "edit" = "Drupal\node\NodeFormController" * }, - * "list" = "Drupal\node\NodeListController", + * "list_builder" = "Drupal\node\NodeListBuilder", * "translation" = "Drupal\node\NodeTranslationController" * }, * base_table = "node", diff --git a/core/modules/node/lib/Drupal/node/Entity/NodeType.php b/core/modules/node/lib/Drupal/node/Entity/NodeType.php index 021ee7d..b187c75 100644 --- a/core/modules/node/lib/Drupal/node/Entity/NodeType.php +++ b/core/modules/node/lib/Drupal/node/Entity/NodeType.php @@ -26,7 +26,7 @@ * "edit" = "Drupal\node\NodeTypeFormController", * "delete" = "Drupal\node\Form\NodeTypeDeleteConfirm" * }, - * "list" = "Drupal\node\NodeTypeListController", + * "list_builder" = "Drupal\node\NodeTypeListBuilder", * }, * admin_permission = "administer content types", * config_prefix = "type", diff --git a/core/modules/node/lib/Drupal/node/NodeListController.php b/core/modules/node/lib/Drupal/node/NodeListBuilder.php similarity index 93% rename from core/modules/node/lib/Drupal/node/NodeListController.php rename to core/modules/node/lib/Drupal/node/NodeListBuilder.php index 4ac1ebb..d80b6b2 100644 --- a/core/modules/node/lib/Drupal/node/NodeListController.php +++ b/core/modules/node/lib/Drupal/node/NodeListBuilder.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\node\NodeListController. + * Contains \Drupal\node\NodeListBuilder. */ namespace Drupal\node; @@ -10,17 +10,18 @@ use Drupal\Component\Utility\String; use Drupal\Core\Datetime\Date; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityListController; +use Drupal\Core\Entity\EntityListBuilder; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Language\Language; -use Drupal\Core\StringTranslation\TranslationInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Provides a list controller for nodes. + * Defines a class to build a listing of node entities. + * + * @see \Drupal\node\Entity\Node */ -class NodeListController extends EntityListController { +class NodeListBuilder extends EntityListBuilder { /** * The date service. @@ -30,7 +31,7 @@ class NodeListController extends EntityListController { protected $dateService; /** - * Constructs a new NodeListController object. + * Constructs a new NodeListBuilder object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. diff --git a/core/modules/node/lib/Drupal/node/NodeTypeListController.php b/core/modules/node/lib/Drupal/node/NodeTypeListBuilder.php similarity index 90% rename from core/modules/node/lib/Drupal/node/NodeTypeListController.php rename to core/modules/node/lib/Drupal/node/NodeTypeListBuilder.php index b1829f6..681fff4 100644 --- a/core/modules/node/lib/Drupal/node/NodeTypeListController.php +++ b/core/modules/node/lib/Drupal/node/NodeTypeListBuilder.php @@ -1,13 +1,13 @@ getLabel($entity); diff --git a/core/modules/system/entity.api.php b/core/modules/system/entity.api.php index c0203bd..ab25a74 100644 --- a/core/modules/system/entity.api.php +++ b/core/modules/system/entity.api.php @@ -760,7 +760,7 @@ function hook_entity_bundle_field_info_alter(&$fields, \Drupal\Core\Entity\Entit * * @param array $operations * Operations array as returned by - * \Drupal\Core\Entity\EntityListControllerInterface::getOperations(). + * \Drupal\Core\Entity\EntityListBuilderInterface::getOperations(). * @param \Drupal\Core\Entity\EntityInterface $entity * The entity on which the linked operations will be performed. */ diff --git a/core/modules/system/lib/Drupal/system/DateFormatListController.php b/core/modules/system/lib/Drupal/system/DateFormatListBuilder.php similarity index 85% rename from core/modules/system/lib/Drupal/system/DateFormatListController.php rename to core/modules/system/lib/Drupal/system/DateFormatListBuilder.php index 9472d8c..be83cd9 100644 --- a/core/modules/system/lib/Drupal/system/DateFormatListController.php +++ b/core/modules/system/lib/Drupal/system/DateFormatListBuilder.php @@ -2,13 +2,13 @@ /** * @file - * Contains \Drupal\system\DateFormatListController. + * Contains \Drupal\system\DateFormatListBuilder. */ namespace Drupal\system; use Drupal\Component\Utility\String; -use Drupal\Core\Config\Entity\ConfigEntityListController; +use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Datetime\Date; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; @@ -16,9 +16,11 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Provides a listing of date formats. + * Defines a class to build a listing of date format entities. + * + * @see \Drupal\system\Entity\DateFormat */ -class DateFormatListController extends ConfigEntityListController { +class DateFormatListBuilder extends ConfigEntityListBuilder { /** * The date service. @@ -28,7 +30,7 @@ class DateFormatListController extends ConfigEntityListController { protected $dateService; /** - * Constructs a new DateFormatListController object. + * Constructs a new DateFormatListBuilder object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. diff --git a/core/modules/system/lib/Drupal/system/Entity/DateFormat.php b/core/modules/system/lib/Drupal/system/Entity/DateFormat.php index ce169b9..309570d 100644 --- a/core/modules/system/lib/Drupal/system/Entity/DateFormat.php +++ b/core/modules/system/lib/Drupal/system/Entity/DateFormat.php @@ -20,7 +20,7 @@ * label = @Translation("Date format"), * controllers = { * "access" = "Drupal\system\DateFormatAccessController", - * "list" = "Drupal\system\DateFormatListController", + * "list_builder" = "Drupal\system\DateFormatListBuilder", * "form" = { * "add" = "Drupal\system\Form\DateFormatAddForm", * "edit" = "Drupal\system\Form\DateFormatEditForm", diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php index d55bb8d..357b77e 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php @@ -22,7 +22,7 @@ * id = "entity_test", * label = @Translation("Test entity"), * controllers = { - * "list" = "Drupal\entity_test\EntityTestListController", + * "list_builder" = "Drupal\entity_test\EntityTestListBuilder", * "view_builder" = "Drupal\entity_test\EntityTestViewBuilder", * "access" = "Drupal\entity_test\EntityTestAccessController", * "form" = { diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestListController.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestListBuilder.php similarity index 65% rename from core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestListController.php rename to core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestListBuilder.php index fddc724..1fbc8a1 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestListController.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestListBuilder.php @@ -2,18 +2,20 @@ /** * @file - * Contains \Drupal\entity_test\EntityTestListController. + * Contains \Drupal\entity_test\EntityTestListBuilder. */ namespace Drupal\entity_test; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityListController; +use Drupal\Core\Entity\EntityListBuilder; /** - * Provides a list controller for entity_test. + * Defines a class to build a listing of entity test entities. + * + * @see \Drupal\entity_test\Entity\EntityTest */ -class EntityTestListController extends EntityListController { +class EntityTestListBuilder extends EntityListBuilder { /** * {@inheritdoc} diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php index ee3d8f3..f7e3f91 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php @@ -20,7 +20,7 @@ * label = @Translation("Taxonomy vocabulary"), * controllers = { * "storage" = "Drupal\taxonomy\VocabularyStorageController", - * "list" = "Drupal\taxonomy\VocabularyListController", + * "list_builder" = "Drupal\taxonomy\VocabularyListBuilder", * "form" = { * "default" = "Drupal\taxonomy\VocabularyFormController", * "reset" = "Drupal\taxonomy\Form\VocabularyResetForm", diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyListController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyListBuilder.php similarity index 88% rename from core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyListController.php rename to core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyListBuilder.php index 104b360..2823551 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyListController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyListBuilder.php @@ -2,18 +2,20 @@ /** * @file - * Contains \Drupal\taxonomy\VocabularyListController. + * Contains \Drupal\taxonomy\VocabularyListBuilder. */ namespace Drupal\taxonomy; -use Drupal\Core\Config\Entity\DraggableListController; +use Drupal\Core\Config\Entity\DraggableListBuilder; use Drupal\Core\Entity\EntityInterface; /** - * Provides a listing of vocabularies. + * Defines a class to build a listing of taxonomy vocabulary entities. + * + * @see \Drupal\taxonomy\Entity\Vocabulary */ -class VocabularyListController extends DraggableListController { +class VocabularyListBuilder extends DraggableListBuilder { /** * {@inheritdoc} diff --git a/core/modules/user/lib/Drupal/user/Entity/Role.php b/core/modules/user/lib/Drupal/user/Entity/Role.php index 2a025d9..0ce5186 100644 --- a/core/modules/user/lib/Drupal/user/Entity/Role.php +++ b/core/modules/user/lib/Drupal/user/Entity/Role.php @@ -21,7 +21,7 @@ * controllers = { * "storage" = "Drupal\user\RoleStorageController", * "access" = "Drupal\user\RoleAccessController", - * "list" = "Drupal\user\RoleListController", + * "list_builder" = "Drupal\user\RoleListBuilder", * "form" = { * "default" = "Drupal\user\RoleFormController", * "delete" = "Drupal\user\Form\UserRoleDelete" diff --git a/core/modules/user/lib/Drupal/user/Entity/User.php b/core/modules/user/lib/Drupal/user/Entity/User.php index 49c66fd..8cac65c 100644 --- a/core/modules/user/lib/Drupal/user/Entity/User.php +++ b/core/modules/user/lib/Drupal/user/Entity/User.php @@ -24,7 +24,7 @@ * controllers = { * "storage" = "Drupal\user\UserStorageController", * "access" = "Drupal\user\UserAccessController", - * "list" = "Drupal\user\Controller\UserListController", + * "list_builder" = "Drupal\user\UserListBuilder", * "view_builder" = "Drupal\Core\Entity\EntityViewBuilder", * "form" = { * "default" = "Drupal\user\ProfileFormController", diff --git a/core/modules/user/lib/Drupal/user/RoleListController.php b/core/modules/user/lib/Drupal/user/RoleListBuilder.php similarity index 82% rename from core/modules/user/lib/Drupal/user/RoleListController.php rename to core/modules/user/lib/Drupal/user/RoleListBuilder.php index c2cd9b9..2d2b9be 100644 --- a/core/modules/user/lib/Drupal/user/RoleListController.php +++ b/core/modules/user/lib/Drupal/user/RoleListBuilder.php @@ -2,18 +2,20 @@ /** * @file - * Contains \Drupal\user\RoleListController. + * Contains \Drupal\user\RoleListBuilder. */ namespace Drupal\user; -use Drupal\Core\Config\Entity\DraggableListController; +use Drupal\Core\Config\Entity\DraggableListBuilder; use Drupal\Core\Entity\EntityInterface; /** - * Provides a listing of user roles. + * Defines a class to build a listing of user role entities. + * + * @see \Drupal\user\Entity\Role */ -class RoleListController extends DraggableListController { +class RoleListBuilder extends DraggableListBuilder { /** * {@inheritdoc} diff --git a/core/modules/user/lib/Drupal/user/Controller/UserListController.php b/core/modules/user/lib/Drupal/user/UserListBuilder.php similarity index 92% rename from core/modules/user/lib/Drupal/user/Controller/UserListController.php rename to core/modules/user/lib/Drupal/user/UserListBuilder.php index 72c1a84..d2fcd3a 100644 --- a/core/modules/user/lib/Drupal/user/Controller/UserListController.php +++ b/core/modules/user/lib/Drupal/user/UserListBuilder.php @@ -2,25 +2,24 @@ /** * @file - * Contains \Drupal\user\Controller\UserListController. + * Contains \Drupal\user\UserListBuilder. */ -namespace Drupal\user\Controller; +namespace Drupal\user; -use Drupal\Core\Entity\EntityControllerInterface; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityListController; +use Drupal\Core\Entity\EntityListBuilder; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\Query\QueryFactory; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Lists user entities. + * Defines a class to build a listing of user entities. * * @see \Drupal\user\Entity\User */ -class UserListController extends EntityListController implements EntityControllerInterface { +class UserListBuilder extends EntityListBuilder { /** * The entity query factory. @@ -30,7 +29,7 @@ class UserListController extends EntityListController implements EntityControlle protected $queryFactory; /** - * Constructs a new UserListController object. + * Constructs a new UserListBuilder object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayFeedTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayFeedTest.php index 484734e..fe101d8 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayFeedTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayFeedTest.php @@ -51,7 +51,7 @@ protected function setUp() { public function testFeedUI() { $this->drupalGet('admin/structure/views'); // Verify that the page lists the test_display_feed view. - // Regression test: ViewsListController::getDisplayPaths() did not properly + // Regression test: ViewListBuilder::getDisplayPaths() did not properly // check whether a DisplayBag was returned in iterating over all displays. $this->assertText('test_display_feed'); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php b/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php index 018d4d9..cc6b037 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php @@ -154,7 +154,7 @@ public function ajaxOperation(ViewStorageInterface $view, $op, Request $request) // If the request is via AJAX, return the rendered list as JSON. if ($request->request->get('js')) { - $list = $this->entityManager()->getListController('view')->render(); + $list = $this->entityManager()->getListBuilder('view')->render(); $response = new AjaxResponse(); $response->addCommand(new ReplaceCommand('#views-entity-list', drupal_render($list))); return $response; diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewListBuilder.php similarity index 95% rename from core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php rename to core/modules/views_ui/lib/Drupal/views_ui/ViewListBuilder.php index 1facb3c..36f20c3 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewListBuilder.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\views_ui\ViewListController. + * Contains \Drupal\views_ui\ViewListBuilder. */ namespace Drupal\views_ui; @@ -10,16 +10,17 @@ use Drupal\Component\Utility\String; use Drupal\Component\Plugin\PluginManagerInterface; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Config\Entity\ConfigEntityListController; -use Drupal\Core\Entity\EntityControllerInterface; +use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Entity\EntityTypeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Provides a listing of Views. + * Defines a class to build a listing of view entities. + * + * @see \Drupal\views\Entity\View */ -class ViewListController extends ConfigEntityListController implements EntityControllerInterface { +class ViewListBuilder extends ConfigEntityListBuilder { /** * The views display plugin manager to use. @@ -40,7 +41,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI } /** - * Constructs a new EntityListController object. + * Constructs a new ViewListBuilder object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. diff --git a/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListControllerTest.php b/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListBuilderTest.php similarity index 85% rename from core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListControllerTest.php rename to core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListBuilderTest.php index 534f824..3f67f0e 100644 --- a/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListControllerTest.php +++ b/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListBuilderTest.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\views_ui\Tests\ViewListControllerTest + * Contains \Drupal\views_ui\Tests\ViewListBuilderTest. */ namespace Drupal\views_ui\Tests; @@ -12,22 +12,22 @@ use Drupal\Tests\UnitTestCase; use Drupal\views\Entity\View; use Drupal\views\ViewExecutableFactory; -use Drupal\views_ui\ViewListController; +use Drupal\views_ui\ViewListBuilder; -class ViewListControllerTest extends UnitTestCase { +class ViewListBuilderTest extends UnitTestCase { public static function getInfo() { return array( - 'name' => 'Views List Controller Unit Test', - 'description' => 'Unit tests the views list controller', + 'name' => 'Views List Builder Unit Test', + 'description' => 'Unit tests the views list builder', 'group' => 'Views UI', ); } /** - * Tests the listing of displays on a views list. + * Tests the listing of displays on a views list builder. * - * @see \Drupal\views_ui\ViewListController::getDisplaysList(). + * @see \Drupal\views_ui\ViewListBuilder::getDisplaysList() */ public function testBuildRowEntityList() { $storage_controller = $this->getMockBuilder('Drupal\views\ViewStorageController') @@ -121,15 +121,15 @@ public function testBuildRowEntityList() { $container->set('plugin.manager.views.display', $display_manager); \Drupal::setContainer($container); - // Setup a view list controller with a mocked buildOperations method, + // Setup a view list builder with a mocked buildOperations method, // because t() is called on there. $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface'); - $view_list_controller = new TestViewListController($entity_type, $storage_controller, $display_manager); - $view_list_controller->setTranslationManager($this->getStringTranslationStub()); + $view_list_builder = new TestViewListBuilder($entity_type, $storage_controller, $display_manager); + $view_list_builder->setTranslationManager($this->getStringTranslationStub()); $view = new View($values, 'view'); - $row = $view_list_controller->buildRow($view); + $row = $view_list_builder->buildRow($view); $this->assertEquals(array('Embed admin label', 'Page admin label'), $row['data']['view_name']['data']['#displays'], 'Wrong displays got added to view list'); $this->assertEquals($row['data']['path'], '/test_page', 'The path of the page display is not added.'); @@ -137,7 +137,7 @@ public function testBuildRowEntityList() { } -class TestViewListController extends ViewListController { +class TestViewListBuilder extends ViewListBuilder { public function buildOperations(EntityInterface $entity) { return array(); diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module index 7f140d3..9f25e89 100644 --- a/core/modules/views_ui/views_ui.module +++ b/core/modules/views_ui/views_ui.module @@ -75,7 +75,7 @@ function views_ui_entity_type_build(array &$entity_types) { ->setFormClass('clone', 'Drupal\views_ui\ViewCloneFormController') ->setFormClass('delete', 'Drupal\views_ui\ViewDeleteFormController') ->setFormClass('break_lock', 'Drupal\views_ui\Form\BreakLockForm') - ->setListClass('Drupal\views_ui\ViewListController') + ->setListBuilderClass('Drupal\views_ui\ViewListBuilder') ->setLinkTemplate('edit-form', 'views_ui.edit') ->setLinkTemplate('edit-display-form', 'views_ui.edit_display') ->setLinkTemplate('preview-form', 'views_ui.preview') diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityListControllerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php similarity index 62% rename from core/tests/Drupal/Tests/Core/Entity/EntityListControllerTest.php rename to core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php index 6db04b5..0d9881f 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityListControllerTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php @@ -2,42 +2,42 @@ /** * @file - * Contains \Drupal\Tests\Core\Entity\EntityListControllerTest. + * Contains \Drupal\Tests\Core\Entity\EntityListBuilderTest. */ namespace Drupal\Tests\Core\Entity; use Drupal\Core\Entity\EntityInterface; -use Drupal\entity_test\EntityTestListController; +use Drupal\entity_test\EntityTestListBuilder; use Drupal\Tests\UnitTestCase; /** - * Tests the entity list controller. + * Tests the entity list builder. * * @group Entity * - * @see \Drupal\entity_test\EntityTestListController + * @see \Drupal\entity_test\EntityTestListBuilder */ -class EntityListControllerTest extends UnitTestCase { +class EntityListBuilderTest extends UnitTestCase { /** - * The entity used to construct the EntityListController. + * The entity used to construct the EntityListBuilder. * * @var \Drupal\user\RoleInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $role; /** - * The EntityListController object to test. + * The EntityListBuilder object to test. * - * @var \Drupal\Core\Entity\EntityListController + * @var \Drupal\Core\Entity\EntityListBuilder */ - protected $entityListController; + protected $entityListBuilder; public static function getInfo() { return array( - 'name' => 'Entity list controller test', - 'description' => 'Unit test of entity access checking system.', + 'name' => 'Entity list builder test', + 'description' => 'Unit test of entity list builder system.', 'group' => 'Entity' ); } @@ -52,7 +52,7 @@ protected function setUp() { $role_storage_controller = $this->getMock('Drupal\user\RoleStorageControllerInterface'); $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface'); $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface'); - $this->entityListController = new TestEntityListController($entity_type, $role_storage_controller, $module_handler); + $this->entityListBuilder = new TestEntityListBuilder($entity_type, $role_storage_controller, $module_handler); } /** @@ -70,7 +70,7 @@ protected function setUp() { * @param bool $ignorewarnings * Whether or not to ignore PHP 5.3+ invalid multibyte sequence warnings. * - * @see \Drupal\Component\Utility\Drupal\Core\Entity\EntityListController::buildRow() + * @see \Drupal\Core\Entity\EntityListBuilder::buildRow() */ public function testBuildRow($input, $expected, $message, $ignorewarnings = FALSE) { $this->role->expects($this->any()) @@ -78,10 +78,10 @@ public function testBuildRow($input, $expected, $message, $ignorewarnings = FALS ->will($this->returnValue($input)); if ($ignorewarnings) { - $built_row = @$this->entityListController->buildRow($this->role); + $built_row = @$this->entityListBuilder->buildRow($this->role); } else { - $built_row = $this->entityListController->buildRow($this->role); + $built_row = $this->entityListBuilder->buildRow($this->role); } $this->assertEquals($built_row['label'], $expected, $message); @@ -101,13 +101,13 @@ public function testBuildRow($input, $expected, $message, $ignorewarnings = FALS public function providerTestBuildRow() { $tests = array(); // Checks that invalid multi-byte sequences are rejected. - $tests[] = array("Foo\xC0barbaz", '', 'EntityTestListController::buildRow() rejects invalid sequence "Foo\xC0barbaz"', TRUE); - $tests[] = array("\xc2\"", '', 'EntityTestListController::buildRow() rejects invalid sequence "\xc2\""', TRUE); - $tests[] = array("Fooÿñ", "Fooÿñ", 'EntityTestListController::buildRow() accepts valid sequence "Fooÿñ"'); + $tests[] = array("Foo\xC0barbaz", '', 'EntityTestListBuilder::buildRow() rejects invalid sequence "Foo\xC0barbaz"', TRUE); + $tests[] = array("\xc2\"", '', 'EntityTestListBuilder::buildRow() rejects invalid sequence "\xc2\""', TRUE); + $tests[] = array("Fooÿñ", "Fooÿñ", 'EntityTestListBuilder::buildRow() accepts valid sequence "Fooÿñ"'); // Checks that special characters are escaped. - $tests[] = array("