Permalink
Browse files

(Fixes issue 757)

  • Loading branch information...
1 parent 22cb3fe commit a6cf02ef1fedfd632446e040b7903cd512d875b2 qiang.xue committed Feb 1, 2010
Showing with 4 additions and 2 deletions.
  1. +1 −0 CHANGELOG
  2. +3 −2 framework/db/schema/CDbCriteria.php
View
@@ -14,6 +14,7 @@ Version 1.0.12 to be released
- Bug: COciSchema::findTableNames() should use upper case for the keys of query results (Qiang)
- Enh #730: Relational queries now respect changes made to CActiveRecord::dbCriteria in the onBeforeFind event (Qiang)
- Enh #737: CUrlManager::createUrl() now supports multidimensional array params (Jonah)
+- Enh #757: Allow CDbCriteria::addInCondition() to use parameter array that is not integer-indexed (Qiang)
Version 1.0.11 December 13, 2009
--------------------------------
@@ -156,10 +156,11 @@ public function addInCondition($column,$values,$operator='AND')
return $this->addCondition('0=1',$operator);
if($n===1)
{
- if($values[0]===null)
+ $value=reset($values);
+ if($value===null)
return $this->addCondition($column.' IS NULL');
$condition=$column.'='.self::PARAM_PREFIX.$this->_paramCount;
- $this->params[self::PARAM_PREFIX.$this->_paramCount++]=$values[0];
+ $this->params[self::PARAM_PREFIX.$this->_paramCount++]=$value;
}
else
{

0 comments on commit a6cf02e

Please sign in to comment.