interface EntityListBuilderInterface

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityListBuilderInterface.php \Drupal\Core\Entity\EntityListBuilderInterface
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityListBuilderInterface.php \Drupal\Core\Entity\EntityListBuilderInterface
  3. 10 core/lib/Drupal/Core/Entity/EntityListBuilderInterface.php \Drupal\Core\Entity\EntityListBuilderInterface

Defines an interface to build entity listings.

Hierarchy

Expanded class hierarchy of EntityListBuilderInterface

All classes that implement EntityListBuilderInterface

1 file declares its use of EntityListBuilderInterface
ConfigTranslationEntityListBuilderInterface.php in core/modules/config_translation/src/Controller/ConfigTranslationEntityListBuilderInterface.php

File

core/lib/Drupal/Core/Entity/EntityListBuilderInterface.php, line 8

Namespace

Drupal\Core\Entity
View source
interface EntityListBuilderInterface {
    
    /**
     * Gets the entity storage.
     *
     * @return \Drupal\Core\Entity\EntityStorageInterface
     *   The storage used by this list builder.
     */
    public function getStorage();
    
    /**
     * Loads entities of this type from storage for listing.
     *
     * 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
     *   indexed by their IDs. Returns an empty array if no matching entities are
     *   found.
     */
    public function load();
    
    /**
     * Provides an array of information to build a list of operation links.
     *
     * @param \Drupal\Core\Entity\EntityInterface $entity
     *   The entity the operations are for.
     *
     * @return array
     *   An associative array of operation link data for this list, keyed by
     *   operation name, containing the following key-value pairs:
     *   - title: The localized title of the operation.
     *   - url: An instance of \Drupal\Core\Url for the operation URL.
     *   - weight: The weight of this operation.
     */
    public function getOperations(EntityInterface $entity);
    
    /**
     * Builds a listing of entities for the given entity type.
     *
     * @return array
     *   A render array as expected by
     *   \Drupal\Core\Render\RendererInterface::render().
     */
    public function render();

}

Members

Title Sort descending Modifiers Object type Summary Overrides
EntityListBuilderInterface::getOperations public function Provides an array of information to build a list of operation links. 1
EntityListBuilderInterface::getStorage public function Gets the entity storage. 1
EntityListBuilderInterface::load public function Loads entities of this type from storage for listing. 1
EntityListBuilderInterface::render public function Builds a listing of entities for the given entity type. 1

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.