Fixing LIMIT clause for Model::find('first') (Ticket #3754)

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6178 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-12-20 14:36:39 +00:00
parent 60f4dd360d
commit c9f59b8713

View file

@ -1524,6 +1524,8 @@ class Model extends Overloadable {
$query['fields'] = 'COUNT(*) AS ' . $db->name('count');
}
$query['order'] = false;
} elseif ($type == 'first') {
$query['limit'] = 1;
}
if (!is_numeric($query['page']) || intval($query['page']) < 1) {