From 7c4c3271118a0bdd8a1d7b85def3899911b00835 Mon Sep 17 00:00:00 2001 From: wei <> Date: Tue, 6 Feb 2007 08:10:29 +0000 Subject: scaffold typo, allow multiple parameters in findBySql. --- .../Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php | 2 +- framework/Data/ActiveRecord/TActiveRecord.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php index cb56d598..c6fc6902 100644 --- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php +++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php @@ -2,7 +2,7 @@ Prado::using('System.Data.ActiveRecord.Scaffold.InputBuilder.TScaffoldInputCommon'); -class MysqlScaffoldInput extends ScaffoldInputCommon +class MysqlScaffoldInput extends TScaffoldInputCommon { protected function createControl($container, $column, $record) { diff --git a/framework/Data/ActiveRecord/TActiveRecord.php b/framework/Data/ActiveRecord/TActiveRecord.php index 9bc74c0f..91ae971a 100644 --- a/framework/Data/ActiveRecord/TActiveRecord.php +++ b/framework/Data/ActiveRecord/TActiveRecord.php @@ -390,6 +390,11 @@ abstract class TActiveRecord extends TComponent */ public function findBySql($sql,$parameters=array()) { + if(!is_array($parameters) && func_num_args() > 1) + { + $parameters = func_get_args(); + array_shift($parameters); + } $gateway = $this->getRecordManager()->getRecordGateway(); $data = $gateway->findRecordsBySql($this,$sql,$parameters); $results = array(); -- cgit v1.2.3