/**
* 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;
}