function PagerSelectExtender::limit

Same name in other branches
  1. 9 core/lib/Drupal/Core/Database/Query/PagerSelectExtender.php \Drupal\Core\Database\Query\PagerSelectExtender::limit()
  2. 10 core/lib/Drupal/Core/Database/Query/PagerSelectExtender.php \Drupal\Core\Database\Query\PagerSelectExtender::limit()
  3. 11.x core/lib/Drupal/Core/Database/Query/PagerSelectExtender.php \Drupal\Core\Database\Query\PagerSelectExtender::limit()

Specify the maximum number of elements per page for this query.

The default if not specified is 10 items per page.

Parameters

int|false $limit: An integer specifying the number of elements per page. If passed a false value (FALSE, 0, NULL), the pager is disabled.

File

core/lib/Drupal/Core/Database/Query/PagerSelectExtender.php, line 140

Class

PagerSelectExtender
Query extender for pager queries.

Namespace

Drupal\Core\Database\Query

Code

public function limit($limit = 10) {
    $this->limit = $limit;
    return $this;
}

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