3 namespace Drupal\Core\Entity;
6 * Defines an interface to build entity listings.
8 interface EntityListBuilderInterface {
11 * Gets the entity storage.
13 * @return \Drupal\Core\Entity\EntityStorageInterface
14 * The storage used by this list builder.
16 public function getStorage();
19 * Loads entities of this type from storage for listing.
21 * This allows the implementation to manipulate the listing, like filtering or
22 * sorting the loaded entities.
24 * @return \Drupal\Core\Entity\EntityInterface[]
25 * An array of entities implementing \Drupal\Core\Entity\EntityInterface
26 * indexed by their IDs. Returns an empty array if no matching entities are
29 public function load();
32 * Provides an array of information to build a list of operation links.
34 * @param \Drupal\Core\Entity\EntityInterface $entity
35 * The entity the operations are for.
38 * An associative array of operation link data for this list, keyed by
39 * operation name, containing the following key-value pairs:
40 * - title: The localized title of the operation.
41 * - url: An instance of \Drupal\Core\Url for the operation URL.
42 * - weight: The weight of this operation.
44 public function getOperations(EntityInterface $entity);
47 * Builds a listing of entities for the given entity type.
50 * A render array as expected by
51 * \Drupal\Core\Render\RendererInterface::render().
53 public function render();