You are here

protected function OpignoModuleListBuilder::getEntityIds in Opigno module 8

Same name and namespace in other branches
  1. 3.x src/OpignoModuleListBuilder.php \Drupal\opigno_module\OpignoModuleListBuilder::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/OpignoModuleListBuilder.php, line 44

Class

OpignoModuleListBuilder
Defines a class to build a listing of Module entities.

Namespace

Drupal\opigno_module

Code

protected function getEntityIds() {
  $ids = array_keys($this
    ->getEntities());

  // Only add the pager if a limit is specified.
  if ($this->limit) {
    $page = \Drupal::request()->query
      ->get('page', 0);
    $limit = $this->limit;
    $start = $limit * $page;
    $ids = array_slice($ids, $start, $limit);
  }
  return $ids;
}