// XXX: this doesn't work, because PDO mandates that all bound arguments
// are used on the query. TODO: Find a better way to do this.
if (!
empty($additional_arguments)) { // $query->where('1 = 1', $additional_arguments);
// $count_query->where('1 = 1', $additional_arguments);
} $start =
microtime(TRUE
);
try { if ($view->pager->
useCountQuery() || !
empty($view->get_total_rows
)) { $view->pager->
executeCountQuery($count_query);
} // Let the pager modify the query to add limits.
$view->pager->
preExecute($query);
if (!
empty($this->limit
) || !
empty($this->offset
)) { // We can't have an offset without a limit, so provide a very large limit instead.
$limit =
intval(!
empty($this->limit
) ?
$this->limit : 999999
);
$offset =
intval(!
empty($this->offset
) ?
$this->offset : 0
);
$query->
range($offset,
$limit);
}