interface EntityListBuilderInterface (View source)

Defines an interface to build entity listings.

Methods

getStorage()

Gets the entity storage.

load()

Loads entities of this type from storage for listing.

array
getOperations(EntityInterface $entity)

Provides an array of information to build a list of operation links.

array
render()

Builds a listing of entities for the given entity type.

Details

EntityStorageInterface getStorage()

Gets the entity storage.

Return Value

EntityStorageInterface

The storage used by this list builder.

EntityInterface[] load()

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 Value

EntityInterface[]

An array of entities implementing \Drupal\Core\Entity\EntityInterface indexed by their IDs. Returns an empty array if no matching entities are found.

array getOperations(EntityInterface $entity)

Provides an array of information to build a list of operation links.

Parameters

EntityInterface $entity

The entity the operations are for.

Return Value

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.

array render()

Builds a listing of entities for the given entity type.

Return Value

array

A render array as expected by \Drupal\Core\Render\RendererInterface::render().