diff options
Diffstat (limited to 'framework/Data/ActiveRecord/TActiveRecordCriteria.php')
-rw-r--r-- | framework/Data/ActiveRecord/TActiveRecordCriteria.php | 12 |
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 |