mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
802b93be2e
commit
727a1f52fc
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user