You are here

protected function SocialGroupContentListBuilder::getEntityIds in Open Social 8

Same name and namespace in other branches
  1. 8.2 modules/social_features/social_group/src/Controller/SocialGroupContentListBuilder.php \Drupal\social_group\Controller\SocialGroupContentListBuilder::getEntityIds()
  2. 8.3 modules/social_features/social_group/src/Controller/SocialGroupContentListBuilder.php \Drupal\social_group\Controller\SocialGroupContentListBuilder::getEntityIds()
  3. 8.4 modules/social_features/social_group/src/Controller/SocialGroupContentListBuilder.php \Drupal\social_group\Controller\SocialGroupContentListBuilder::getEntityIds()

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

Return value

array An array of entity IDs.

Overrides EntityListBuilder::getEntityIds

File

modules/social_features/social_group/src/Controller/SocialGroupContentListBuilder.php, line 76

Class

SocialGroupContentListBuilder
Provides a list controller for group content from GroupContentListBuilder.

Namespace

Drupal\social_group\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());
  $query
    ->condition('type', 'group_membership', 'CONTAINS');

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