You are here

public function UserListBuilder::load in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/src/UserListBuilder.php \Drupal\user\UserListBuilder::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

\Drupal\Core\Entity\EntityInterface[] An array of entities implementing \Drupal\Core\Entity\EntityInterface.

Overrides EntityListBuilder::load

File

core/modules/user/src/UserListBuilder.php, line 84
Contains \Drupal\user\UserListBuilder.

Class

UserListBuilder
Defines a class to build a listing of user entities.

Namespace

Drupal\user

Code

public function load() {
  $entity_query = $this->queryFactory
    ->get('user');
  $entity_query
    ->condition('uid', 0, '<>');
  $entity_query
    ->pager(50);
  $header = $this
    ->buildHeader();
  $entity_query
    ->tableSort($header);
  $uids = $entity_query
    ->execute();
  return $this->storage
    ->loadMultiple($uids);
}