forked from CakeDC/users
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathusers_app_model.php
55 lines (50 loc) · 1.18 KB
/
users_app_model.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* Copyright 2010, Cake Development Corporation (http://cakedc.com)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2010, Cake Development Corporation (http://cakedc.com)
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
* Users App Model
*
* @package users
* @subpackage users.models
*/
class UsersAppModel extends AppModel {
/**
* Plugin name
*
* @var string $plugin
*/
public $plugin = 'Users';
/**
* Behaviors
*
* @var array
*/
public $actsAs = array('Containable');
/**
* Customized paginateCount method
*
* @param array
* @param integer
* @param array
* @return
*/
function paginateCount($conditions = array(), $recursive = 0, $extra = array()) {
$parameters = compact('conditions');
if ($recursive != $this->recursive) {
$parameters['recursive'] = $recursive;
}
if (isset($extra['type']) && isset($this->_findMethods[$extra['type']])) {
$extra['operation'] = 'count';
return $this->find($extra['type'], array_merge($parameters, $extra));
} else {
return $this->find('count', array_merge($parameters, $extra));
}
}
}