You are here

public function TeamListBuilder::load in Apigee Edge 8

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

\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.

Overrides EntityListBuilder::load

File

modules/apigee_edge_teams/src/Entity/ListBuilder/TeamListBuilder.php, line 90

Class

TeamListBuilder
General entity listing builder for teams.

Namespace

Drupal\apigee_edge_teams\Entity\ListBuilder

Code

public function load() {

  // Compared with a usual entity collection page this listing page is also
  // available to _all_ logged in users so it must be ensured that users
  // can see only those teams in this list that they have view access.
  // @see \Drupal\apigee_edge_teams\Entity\TeamAccessHandler
  return array_filter(parent::load(), function (TeamInterface $entity) {
    return $entity
      ->access('view');
  });
}