mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding DboSource::value() to findCount() to wrap the count in dbo specific quoting
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5350 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
126fac4145
commit
3f25e0c44d
1 changed files with 3 additions and 1 deletions
|
@ -1477,7 +1477,9 @@ class Model extends Overloadable {
|
|||
* @see Model::findAll
|
||||
*/
|
||||
function findCount($conditions = null, $recursive = 0) {
|
||||
list($data) = $this->findAll($conditions, 'COUNT(*) AS count', false, null, 1, $recursive);
|
||||
$db =& ConnectionManager::getDataSource($this->useDbConfig);
|
||||
|
||||
list($data) = $this->findAll($conditions, 'COUNT(*) AS ' . $db->value('count'), false, null, 1, $recursive);
|
||||
|
||||
if (isset($data[0]['count'])) {
|
||||
return $data[0]['count'];
|
||||
|
|
Loading…
Reference in a new issue