getSheets() public method

The paths to the sheets' data are read from the [Content_Types].xml file.
public getSheets ( ) : Sheet[]
return Box\Spout\Reader\XLSX\Sheet[] Sheets within the XLSX file
Beispiel #1
0
 /**
  * @param string $filePath Path of the file to be read
  * @param \Box\Spout\Reader\XLSX\ReaderOptions $options Reader's current options
  * @param \Box\Spout\Reader\XLSX\Helper\SharedStringsHelper $sharedStringsHelper
  * @param \Box\Spout\Common\Helper\GlobalFunctionsHelper $globalFunctionsHelper
  * @throws \Box\Spout\Reader\Exception\NoSheetsFoundException If there are no sheets in the file
  */
 public function __construct($filePath, $options, $sharedStringsHelper, $globalFunctionsHelper)
 {
     // Fetch all available sheets
     $sheetHelper = new SheetHelper($filePath, $options, $sharedStringsHelper, $globalFunctionsHelper);
     $this->sheets = $sheetHelper->getSheets();
     if (count($this->sheets) === 0) {
         throw new NoSheetsFoundException('The file must contain at least one sheet.');
     }
 }