Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. QueryBase.php

function QueryBase::pager

Overrides QueryInterface::pager

File

core/lib/Drupal/Core/Entity/Query/QueryBase.php, line 292

Class

QueryBase
The base entity query class.

Namespace

Drupal\Core\Entity\Query

Code

public function pager($limit = 10, $element = NULL) {
    // Even when not using SQL, storing the element PagerSelectExtender is as
    // good as anywhere else.
    if (!isset($element)) {
        $element = \Drupal::service('pager.manager')->getMaxPagerElementId() + 1;
    }
    $this->pager = [
        'limit' => $limit,
        'element' => $element,
    ];
    return $this;
}
RSS feed
Powered by Drupal