本文整理汇总了PHP中MysqliDb::paginate方法的典型用法代码示例。如果您正苦于以下问题:PHP MysqliDb::paginate方法的具体用法?PHP MysqliDb::paginate怎么用?PHP MysqliDb::paginate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MysqliDb
的用法示例。
在下文中一共展示了MysqliDb::paginate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: paginate
/**
* Pagination wraper to get()
*
* @access public
* @param int $page Page number
* @param array|string $fields Array or coma separated list of fields to fetch
* @return array
*/
private function paginate($page, $fields = null)
{
$this->db->pageLimit = self::$pageLimit;
$res = $this->db->paginate($this->dbTable, $page, $fields);
self::$totalPages = $this->db->totalPages;
return $res;
}
示例2: paginate
/**
* Pagination wraper to get()
*
* @access public
* @param int $page Page number
* @param array|string $fields Array or coma separated list of fields to fetch
* @return array
*/
private function paginate($page, $fields = null)
{
$this->db->pageLimit = self::$pageLimit;
$res = $this->db->paginate($this->dbTable, $page, $fields);
self::$totalPages = $this->db->totalPages;
if ($this->db->count == 0) {
return null;
}
foreach ($res as &$r) {
$this->processArrays($r);
$this->data = $r;
$this->processAllWith($r, false);
if ($this->returnType == 'Object') {
$item = new static($r);
$item->isNew = false;
$objects[] = $item;
}
}
$this->_with = array();
if ($this->returnType == 'Object') {
return $objects;
}
if ($this->returnType == 'Json') {
return json_encode($res);
}
return $res;
}