summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcarl <>2008-10-13 11:15:28 +0000
committercarl <>2008-10-13 11:15:28 +0000
commit7eeb6b5a658f47b35aa99b1da80bfd5aed7e94d4 (patch)
tree0e7b267ce4c4c61556f621d8c5951266766ea548
parent54d7e31492586e274c32afc3b922a5b7bd90c9ab (diff)
LIMIT 1 for ActiveRecord find() and findBy()
-rw-r--r--HISTORY1
-rw-r--r--framework/Data/ActiveRecord/TActiveRecord.php2
2 files changed, 3 insertions, 0 deletions
diff --git a/HISTORY b/HISTORY
index 1e335069..a6b1f986 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,5 +1,6 @@
Version 3.1.3 To Be Released
============================
+ENH: Ticket#809 - "LIMIT 1" for ActiveRecord find() and findBy() (Carl)
BUG: Ticket#856 - Assets PRADO_CHMOD constant missing in several places (Carl)
ENH: Ticket#848 - TCache "set" and "add" with empty values (Carl)
ENH: Ticket#756 - TDateFormat & TNumberFormat - allow settings default text when Value isn't set. (Carl)
diff --git a/framework/Data/ActiveRecord/TActiveRecord.php b/framework/Data/ActiveRecord/TActiveRecord.php
index 1afbb043..4e6fd134 100644
--- a/framework/Data/ActiveRecord/TActiveRecord.php
+++ b/framework/Data/ActiveRecord/TActiveRecord.php
@@ -552,6 +552,7 @@ abstract class TActiveRecord extends TComponent
{
$args = func_num_args() > 1 ? array_slice(func_get_args(),1) : null;
$criteria = $this->getRecordCriteria($criteria,$parameters, $args);
+ $criteria->setLimit(1);
$data = $this->getRecordGateway()->findRecordsByCriteria($this,$criteria);
return $this->populateObject($data);
}
@@ -629,6 +630,7 @@ abstract class TActiveRecord extends TComponent
{
$args = func_num_args() > 1 ? array_slice(func_get_args(),1) : null;
$criteria = $this->getRecordCriteria($sql,$parameters, $args);
+ $criteria->setLimit(1);
$data = $this->getRecordGateway()->findRecordBySql($this,$criteria);
return $this->populateObject($data);
}