Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SqlBase.php

function 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 307

Class

SqlBase
A common base class for sql based pager.

Namespace

Drupal\views\Plugin\views\pager

Code

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']));
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal