Cleaned up the paginate comment remnants and added the undocumented 'extra' parameter to paginate
git-svn-id: file:///svn-source/pmgr/branches/initial_20090526/site@52 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -84,9 +84,9 @@ class AppModel extends Model {
|
||||
// without changing a bunch of core code is near impossible.
|
||||
|
||||
var $paginate_rows_save;
|
||||
function paginate($conditions, $fields, $order, $limit, $page = 1, $recursive = null) {
|
||||
function paginate($conditions, $fields, $order, $limit, $page = 1, $recursive = null, $extra = null) {
|
||||
/* pr("paginate"); */
|
||||
/* pr(array_merge(compact('conditions', 'fields', 'order', 'limit', 'page', 'recursive'))); */
|
||||
/* pr(array_merge(compact('conditions', 'fields', 'order', 'limit', 'page', 'recursive', 'extra'))); */
|
||||
if ($page > 1 && isset($limit))
|
||||
$offset = ($page - 1) * $limit;
|
||||
else
|
||||
@@ -95,6 +95,7 @@ class AppModel extends Model {
|
||||
}
|
||||
function paginateCount($conditions = null, $recursive = null, $extra = null) {
|
||||
/* pr("paginateCount"); */
|
||||
/* pr(array_merge(compact('conditions', 'recursive', 'extra'))); */
|
||||
|
||||
if (!isset($recursive))
|
||||
$recursive = $this->recursive;
|
||||
@@ -105,35 +106,4 @@ class AppModel extends Model {
|
||||
return count($this->paginate_rows_save);
|
||||
}
|
||||
|
||||
// Code as found in the controller
|
||||
/* function paginate($conditions, $fields, $order, $limit, $page = 1, $recursive = null) { */
|
||||
/* pr("paginate"); */
|
||||
/* pr(array_merge(compact('conditions', 'fields', 'order', 'limit', 'page', 'recursive'))); */
|
||||
|
||||
/* $parameters = compact('conditions', 'fields', 'order', 'limit', 'page'); */
|
||||
/* if ($recursive != $this->recursive) { */
|
||||
/* $parameters['recursive'] = $recursive; */
|
||||
/* } */
|
||||
|
||||
/* $results = $this->find($type, array_merge($parameters, $extra)); */
|
||||
/* pr("paginate end"); */
|
||||
/* pr($results); */
|
||||
/* } */
|
||||
|
||||
/* function paginateCount($conditions = null, $recursive = null, $extra = null) { */
|
||||
/* pr("paginateCount"); */
|
||||
/* pr(array_merge(compact('conditions', 'recursive'), $extra)); */
|
||||
|
||||
/* $parameters = compact('conditions'); */
|
||||
/* if ($recursive != $this->recursive) { */
|
||||
/* $parameters['recursive'] = $recursive; */
|
||||
/* } */
|
||||
/* $count = $this->find('count', array_merge($parameters, $extra)); */
|
||||
|
||||
/* pr("paginateCount end: $count"); */
|
||||
/* return $count; */
|
||||
/* } */
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user