All that is needed is to add the method listed below. The parameters should be pretty obvious.
public function loadFixtureArray($fixtureName,$tableName,$fixtureArray)
{
if($tableName[0]===':')
$tableName=substr($tableName,1);
else
{
$modelClass=Yii::import($tableName,true);
$tableName=CActiveRecord::model($modelClass)->tableName();
}
if(($prefix=$this->getDbConnection()->tablePrefix)!==null)
$tableName=preg_replace('/{{(.*?)}}/',$prefix.'\1',$tableName);
$this->resetTable($tableName);
$rows=array();
$schema=$this->getDbConnection()->getSchema();
$builder=$schema->getCommandBuilder();
$table=$schema->getTable($tableName);
foreach($fixtureArray as $alias=>$row)
{
$builder->createInsertCommand($table,$row)->execute();
$primaryKey=$table->primaryKey;
if($table->sequenceName!==null)
{
if(is_string($primaryKey) && !isset($row[$primaryKey]))
$row[$primaryKey]=$builder->getLastInsertID($table);
elseif(is_array($primaryKey))
{
foreach($primaryKey as $pk)
{
if(!isset($row[$pk]))
{
$row[$pk]=$builder->getLastInsertID($table);
break;
}
}
}
}
$rows[$alias]=$row;
}
if(is_array($rows) && is_string($fixtureName))
{
$this->_rows[$fixtureName]=$rows;
if(isset($modelClass))
{
foreach(array_keys($rows) as $alias)
$this->_records[$fixtureName][$alias]=$modelClass;
}
}
}

Help













