function EntityListBuilder::getEntityIds

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Entity/EntityListBuilder.php \Drupal\Core\Entity\EntityListBuilder::getEntityIds()

Loads entity IDs using a pager sorted by the entity id.

Return value

array An array of entity IDs.

1 method overrides EntityListBuilder::getEntityIds()
MediaListBuilder::getEntityIds in core/modules/media/src/MediaListBuilder.php
Loads entity IDs using a pager sorted by the entity id.

File

core/lib/Drupal/Core/Entity/EntityListBuilder.php, line 96

Class

EntityListBuilder
Defines a generic implementation to build a listing of entities.

Namespace

Drupal\Core\Entity

Code

protected function getEntityIds() {
  $query = $this->getStorage()
    ->getQuery()
    ->accessCheck(TRUE)
    ->sort($this->entityType
    ->getKey('id'));
  // Only add the pager if a limit is specified.
  if ($this->limit) {
    $query->pager($this->limit);
  }
  return $query->execute();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.