summaryrefslogtreecommitdiff
path: root/framework/Data/ActiveRecord/TActiveRecordCriteria.php
diff options
context:
space:
mode:
authorwei <>2007-01-23 12:55:49 +0000
committerwei <>2007-01-23 12:55:49 +0000
commit1c92c3a9fb320ec35949634e53b28ee4ab79f138 (patch)
tree4becb5ff4edca26ca283e5a11506f28e5f3d0f08 /framework/Data/ActiveRecord/TActiveRecordCriteria.php
parent9e6fdda71cf70275fcf7e4b09230daa713c18b70 (diff)
fix pgsql schema table problems.
Diffstat (limited to 'framework/Data/ActiveRecord/TActiveRecordCriteria.php')
-rw-r--r--framework/Data/ActiveRecord/TActiveRecordCriteria.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/framework/Data/ActiveRecord/TActiveRecordCriteria.php b/framework/Data/ActiveRecord/TActiveRecordCriteria.php
index 457b5dc0..968a2691 100644
--- a/framework/Data/ActiveRecord/TActiveRecordCriteria.php
+++ b/framework/Data/ActiveRecord/TActiveRecordCriteria.php
@@ -40,9 +40,16 @@ class TActiveRecordCriteria extends TComponent
/**
* Creates a new criteria with given condition;
+ * @param string sql string after the WHERE stanza
+ * @param mixed named or indexed parameters, accepts as multiple arguments.
*/
public function __construct($condition=null,$parameters=array())
{
+ if(!is_array($parameters) && func_num_args() > 2)
+ {
+ $parameters = func_get_args();
+ array_shift($parameters);
+ }
$this->setCondition($condition);
$this->_parameters=new TAttributeCollection((array)$parameters);
$this->_ordersBy=new TAttributeCollection;
@@ -141,6 +148,11 @@ class TActiveRecordCriteria extends TComponent
{
$this->_offset=$value;
}
+
+ public function __toString()
+ {
+ return $this->getCondition();
+ }
}
?> \ No newline at end of file