protected function Pager::setTotalPages in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Pager/Pager.php \Drupal\Core\Pager\Pager::setTotalPages()
- 9 core/lib/Drupal/Core/Pager/Pager.php \Drupal\Core\Pager\Pager::setTotalPages()
Sets the total number of pages.
Parameters
int $totalItems: The total number of items.
int $limit: The maximum number of items per page.
File
- core/
lib/ Drupal/ Core/ Pager/ Pager.php, line 77
Class
- Pager
- A value object that represents a pager.
Namespace
Drupal\Core\PagerCode
protected function setTotalPages($totalItems, $limit) {
$this->totalPages = (int) ceil($totalItems / $limit);
}