public function SqlBase::setCurrentPage in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/src/Plugin/views/pager/SqlBase.php \Drupal\views\Plugin\views\pager\SqlBase::setCurrentPage()
- 9 core/modules/views/src/Plugin/views/pager/SqlBase.php \Drupal\views\Plugin\views\pager\SqlBase::setCurrentPage()
Set the current page.
Parameters
$number: If provided, the page number will be set to this. If NOT provided, the page number will be set from the pager manager service.
Overrides PagerPluginBase::setCurrentPage
1 call to SqlBase::setCurrentPage()
- SqlBase::updatePageInfo in core/
modules/ views/ src/ Plugin/ views/ pager/ SqlBase.php - Update global paging info.
File
- core/
modules/ views/ src/ Plugin/ views/ pager/ SqlBase.php, line 298
Class
- SqlBase
- A common base class for sql based pager.
Namespace
Drupal\views\Plugin\views\pagerCode
public function setCurrentPage($number = NULL) {
if (isset($number)) {
$this->current_page = max(0, $number);
return;
}
$this->current_page = max(0, $this->pagerParameters
->findPage($this->options['id']));
}