PHP Class Box\Spout\Reader\XLSX\Helper\SheetHelper

Show file Open project: box/spout Class Usage Examples

Protected Properties

Property Type Description
$filePath Path of the XLSX file being read
$globalFunctionsHelper Helper to work with global functions
$options Reader's current options
$sharedStringsHelper Helper to work with shared strings

Public Methods

Method Description
__construct ( string $filePath, ReaderOptions $options, $sharedStringsHelper, Box\Spout\Common\Helper\GlobalFunctionsHelper $globalFunctionsHelper )
getSheets ( ) : Sheet[] Returns the sheets metadata of the file located at the previously given file path.

Protected Methods

Method Description
getSheetDataXMLFilePathForSheetId ( string $sheetId ) : string
getSheetFromSheetXMLNode ( Box\Spout\Reader\Wrapper\XMLReader $xmlReaderOnSheetNode, integer $sheetIndexZeroBased ) : Sheet Returns an instance of a sheet, given the XML node describing the sheet - from "workbook.xml".

Method Details

__construct() public method

public __construct ( string $filePath, ReaderOptions $options, $sharedStringsHelper, Box\Spout\Common\Helper\GlobalFunctionsHelper $globalFunctionsHelper )
$filePath string Path of the XLSX file being read
$options Box\Spout\Reader\XLSX\ReaderOptions Reader's current options
$globalFunctionsHelper Box\Spout\Common\Helper\GlobalFunctionsHelper

getSheetDataXMLFilePathForSheetId() protected method

protected getSheetDataXMLFilePathForSheetId ( string $sheetId ) : string
$sheetId string The sheet ID, as defined in "workbook.xml"
return string The XML file path describing the sheet inside "workbook.xml.res", for the given sheet ID

getSheetFromSheetXMLNode() protected method

We can find the XML file path describing the sheet inside "workbook.xml.res", by mapping with the sheet ID ("r:id" in "workbook.xml", "Id" in "workbook.xml.res").
protected getSheetFromSheetXMLNode ( Box\Spout\Reader\Wrapper\XMLReader $xmlReaderOnSheetNode, integer $sheetIndexZeroBased ) : Sheet
$xmlReaderOnSheetNode Box\Spout\Reader\Wrapper\XMLReader XML Reader instance, pointing on the node describing the sheet, as defined in "workbook.xml"
$sheetIndexZeroBased integer Index of the sheet, based on order of appearance in the workbook (zero-based)
return Box\Spout\Reader\XLSX\Sheet Sheet instance

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

Property Details

$filePath protected property

Path of the XLSX file being read
protected $filePath

$globalFunctionsHelper protected property

Helper to work with global functions
protected $globalFunctionsHelper

$options protected property

Reader's current options
protected $options

$sharedStringsHelper protected property

Helper to work with shared strings
protected $sharedStringsHelper