From 727a1f52fc0cc5aa541c154bf2861fdd2e6c8228 Mon Sep 17 00:00:00 2001 From: Saophalkun Ponlu Date: Wed, 20 Aug 2008 02:38:45 +0000 Subject: [PATCH] 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 --- dev/CsvBulkLoader.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dev/CsvBulkLoader.php b/dev/CsvBulkLoader.php index 66c0dd64f..9b4df31e4 100644 --- a/dev/CsvBulkLoader.php +++ b/dev/CsvBulkLoader.php @@ -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) {