Fixing 'ambiguous column' bug in Model::findCount()

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4592 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-03-05 17:47:16 +00:00
parent 8131f2a55c
commit 3b0a6bf5d4

View file

@ -1491,7 +1491,7 @@ class Model extends Overloadable {
* @see Model::findAll
*/
function findCount($conditions = null, $recursive = 0) {
list($data) = $this->findAll($conditions, 'COUNT(*) AS count', $this->primaryKey, null, 1, $recursive);
list($data) = $this->findAll($conditions, 'COUNT(*) AS count', $this->escapeField(), null, 1, $recursive);
if (isset($data[0]['count'])) {
return $data[0]['count'];