You are here

protected function GroupContentListBuilder::getEntityIds in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/Controller/GroupContentListBuilder.php \Drupal\group\Entity\Controller\GroupContentListBuilder::getEntityIds()

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

Return value

array An array of entity IDs.

Overrides EntityListBuilder::getEntityIds

File

src/Entity/Controller/GroupContentListBuilder.php, line 76

Class

GroupContentListBuilder
Provides a list controller for group content entities.

Namespace

Drupal\group\Entity\Controller

Code

protected function getEntityIds() {
  $query = $this
    ->getStorage()
    ->getQuery();
  $query
    ->sort($this->entityType
    ->getKey('id'));

  // Only show group content for the group on the route.
  $query
    ->condition('gid', $this->group
    ->id());

  // Only add the pager if a limit is specified.
  if ($this->limit) {
    $query
      ->pager($this->limit);
  }
  return $query
    ->execute();
}