public function 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 drupal/core/modules/views/lib/Drupal/views/Plugin/views/pager/SqlBase.php
Set the current page.

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php, line 117
Definition of Drupal\views\Plugin\views\pager\PagerPluginBase.

Class

PagerPluginBase
The base plugin to handle pager.

Namespace

Drupal\views\Plugin\views\pager

Code

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