From c9f59b87132eb24fb4ae29524599338030536ecd Mon Sep 17 00:00:00 2001 From: nate Date: Thu, 20 Dec 2007 14:36:39 +0000 Subject: [PATCH] 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 --- cake/libs/model/model.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 8e8b85494..bbb9269ce 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -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) {