You are here

public function GoogleMini::setPageAndResultsPerPage in Google Search Appliance 5

Same name and namespace in other branches
  1. 6.2 GoogleMini.php \GoogleMini::setPageAndResultsPerPage()

Set page of result set to be shown and sets number of results per page

Parameters

int $page:

File

./GoogleMini.php, line 189

Class

GoogleMini

Code

public function setPageAndResultsPerPage($page = 0, $results = 10) {
  $end = $page * $results + $results;
  if ($end > GOOGLE_MINI_MAX_RESULTS) {
    throw new GoogleMiniCriteriaException("You cannot get more than " . GOOGLE_MINI_MAX_RESULTS . " results per page, requested {$end}", 2);
  }
  $this
    ->setQueryPart('start', $page * $results);
  $this
    ->setQueryPart('num', $results);
  return true;
}