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:
phpnut 2007-06-26 19:02:10 +00:00
parent 126fac4145
commit 3f25e0c44d

View file

@ -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'];