change the return type of processAll of CsvBulkLoader from DataObjectSet to int, the number of affected row

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@61122 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Saophalkun Ponlu 2008-08-20 02:38:45 +00:00
parent 802b93be2e
commit 727a1f52fc

View File

@ -37,7 +37,8 @@ class CsvBulkLoader extends BulkLoader {
$file = fopen($filepath, 'r');
if(!$file) return false;
$return = new DataObjectSet();
//$return = new DataObjectSet();
$numRecords = 0;
if($this->hasHeaderRow && $this->columnMap) {
$columnRow = fgetcsv($file, 0, $this->delimiter, $this->enclosure);
@ -82,13 +83,13 @@ class CsvBulkLoader extends BulkLoader {
$indexedRow[$origColumnName] = $row[count($indexedRow)];
}
$return->push($this->processRecord($indexedRow, $columnMap));
$numRecords++;
//$return->push($this->processRecord($indexedRow, $columnMap));
}
fclose($file);
return $return;
return $numRecords;
}
protected function processRecord($record, $columnMap, $preview = false) {