You are here

public function PagerPluginBase::setCurrentPage in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/pager/PagerPluginBase.php \Drupal\views\Plugin\views\pager\PagerPluginBase::setCurrentPage()
  2. 9 core/modules/views/src/Plugin/views/pager/PagerPluginBase.php \Drupal\views\Plugin\views\pager\PagerPluginBase::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 global page array.

1 method overrides PagerPluginBase::setCurrentPage()
SqlBase::setCurrentPage in core/modules/views/src/Plugin/views/pager/SqlBase.php
Set the current page.

File

core/modules/views/src/Plugin/views/pager/PagerPluginBase.php, line 91

Class

PagerPluginBase
Base class for views pager plugins.

Namespace

Drupal\views\Plugin\views\pager

Code

public function setCurrentPage($number = NULL) {
  if (!is_numeric($number) || $number < 0) {
    $number = 0;
  }
  $this->current_page = $number;
}