UserListBuilder::load

public 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 80

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);
}
doc_Drupal
2016-10-29 09:52:39
Comments
Leave a Comment

Please login to continue.