Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

index fix.

  • Loading branch information...
commit 1ce05a4c65e8456b6d307357cd0e57620d2c5665 1 parent e9320f4
qiang.xue authored
View
10 framework/db/ar/CActiveFinder.php
@@ -73,7 +73,17 @@ public function query($criteria,$all=false)
$this->_joinTree->afterFind();
if($all)
+ {
$result = array_values($this->_joinTree->records);
+ if ($criteria->index!==null)
+ {
+ $index=$criteria->index;
+ $array=array();
+ foreach($result as $object)
+ $array[$object->$index]=$object;
+ $result=$array;
+ }
+ }
else if(count($this->_joinTree->records))
$result = reset($this->_joinTree->records);
else
View
2  framework/db/ar/CActiveRecord.php
@@ -1719,7 +1719,7 @@ public function populateRecords($data,$callAfterFind=true,$index=null)
{
if(($record=$this->populateRecord($attributes,$callAfterFind))!==null)
{
- if(empty($index))
+ if($index===null)
$records[]=$record;
else
$records[$record->$index]=$record;
Please sign in to comment.
Something went wrong with that request. Please try again.