You are here

function views_litepager_plugin_pager_lite::query in Views Litepager 6.3

Same name and namespace in other branches
  1. 7.3 views_litepager_plugin_pager_lite.inc \views_litepager_plugin_pager_lite::query()

Modify the query for paging

This is called during the build phase and can directly modify the query.

Overrides views_plugin_pager_full::query

File

./views_litepager_plugin_pager_lite.inc, line 19
Extend Full Pager plugin to create Lite pager

Class

views_litepager_plugin_pager_lite
@file Extend Full Pager plugin to create Lite pager

Code

function query() {
  parent::query();
  $next_page = TRUE;
  if (!empty($this->options['total_pages'])) {
    if ($this->current_page + 1 >= $this->options['total_pages']) {
      $next_page = FALSE;
    }
  }
  if (empty($this->options['items_per_page'])) {
    $next_page = FALSE;
  }
  if ($next_page) {
    $limit = $this->options['items_per_page'];
    $this->view->query
      ->set_limit($limit + 1);
  }
}