getWorksheetIndex() public method

Returns a worksheet index by name
public getWorksheetIndex ( string $name ) : integer | false
$name string
return integer | false Returns false in case there is no worksheet with this name
Ejemplo n.º 1
0
 /**
  * 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;
 }