Skip to content

Commit

Permalink
Adds SeekableIterator to ExcelReader
Browse files Browse the repository at this point in the history
Adds SeekableIterator, defines the protected parameter `$columnHeaders`
and helps IDE-s learn about `$excel`
  • Loading branch information
afurculita committed Feb 10, 2015
1 parent 8f7f225 commit 489f02c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Ddeboer/DataImport/Reader/ExcelReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
* @link http://phpexcel.codeplex.com/
* @link https://github.com/logiQ/PHPExcel
*/
class ExcelReader implements CountableReaderInterface
class ExcelReader implements CountableReaderInterface, \SeekableIterator
{
protected $worksheet;
protected $headerRowNumber;
protected $pointer = 0;
protected $columnHeaders;

/**
* Total number of rows
Expand All @@ -35,6 +36,7 @@ public function __construct(\SplFileObject $file, $headerRowNumber = null, $acti
{
$reader = \PHPExcel_IOFactory::createReaderForFile($file->getPathName());
$reader->setReadDataOnly(true);
/** @var \PHPExcel $excel */
$excel = $reader->load($file->getPathname());

if (null !== $activeSheet) {
Expand Down

0 comments on commit 489f02c

Please sign in to comment.