/** * Parse the workbook. * * @param SpreadsheetInterface $workbook * * @return SheetCollection */ public function parse(SpreadsheetInterface $workbook) { // Init sheet collection $collection = new SheetCollection(); // Sheet parser $parser = new SheetParser($this->settings); // Loop through all worksheets foreach ($workbook->getWorksheets() as $worksheet) { $index = $workbook->getWorksheetIndex($worksheet); if ($this->isSelected($index)) { // Push the sheet onto the workbook $collection->push($parser->parse($workbook, $worksheet, $index)); } } return $collection; }
/** * Parse the workbook. * * @param PHPExcel $workbook * * @return SheetCollection */ public function parse(PHPExcel $workbook) { // Init sheet collection $collection = new SheetCollection(); // Set the workbook title $collection->setTitle($workbook->getProperties()->getTitle()); // Worksheet parser $parser = new SheetParser($this->settings); // Loop through all worksheets foreach ($workbook->getWorksheetIterator() as $index => $worksheet) { if ($this->isSelected($index)) { // Push the sheet onto the workbook $collection->push($parser->parse($worksheet)); } } return $collection; }