PHP Class Box\Spout\Writer\ODS\Internal\Worksheet

Inheritance: implements Box\Spout\Writer\Common\Internal\WorksheetInterface
Datei anzeigen Open project: box/spout

Protected Properties

Property Type Description
$externalSheet The "external" sheet
$lastWrittenRowIndex Index of the last written row
$maxNumColumns Maximum number of columns among all the written rows
$sheetFilePointer Pointer to the temporary sheet data file (e.g. worksheets-temp/sheet1.xml)
$stringHelper To help with string manipulation
$stringsEscaper Strings escaper
$worksheetFilePath Path to the XML file that will contain the sheet data

Public Methods

Method Description
__construct ( Sheet $externalSheet, string $worksheetFilesFolder )
addRow ( array $dataRow, Style $style ) : void Adds data to the worksheet.
close ( ) : void Closes the worksheet
getExternalSheet ( ) : Sheet
getLastWrittenRowIndex ( ) : integer
getTableElementStartAsString ( ) : string Returns the table XML root node as string.
getWorksheetFilePath ( ) : string

Protected Methods

Method Description
getCellXML ( mixed $cellValue, integer $styleIndex, integer $numTimesValueRepeated ) : string Returns the cell XML content, given its value.
startSheet ( ) : void Prepares the worksheet to accept data The XML file does not contain the "" node as it contains the sheet's name which may change during the execution of the program. It will be added at the end.
throwIfSheetFilePointerIsNotAvailable ( ) : void Checks if the book has been created. Throws an exception if not created yet.

Method Details

__construct() public method

public __construct ( Sheet $externalSheet, string $worksheetFilesFolder )
$externalSheet Box\Spout\Writer\Common\Sheet The associated "external" sheet
$worksheetFilesFolder string Temporary folder where the files to create the ODS will be stored

addRow() public method

Adds data to the worksheet.
public addRow ( array $dataRow, Style $style ) : void
$dataRow array Array containing data to be written. Cannot be empty. Example $dataRow = ['data1', 1234, null, '', 'data5'];
$style Box\Spout\Writer\Style\Style Style to be applied to the row. NULL means use default style.
return void

close() public method

Closes the worksheet
public close ( ) : void
return void

getCellXML() protected method

Returns the cell XML content, given its value.
protected getCellXML ( mixed $cellValue, integer $styleIndex, integer $numTimesValueRepeated ) : string
$cellValue mixed The value to be written
$styleIndex integer Index of the used style
$numTimesValueRepeated integer Number of times the value is consecutively repeated
return string The cell XML content

getExternalSheet() public method

public getExternalSheet ( ) : Sheet
return Box\Spout\Writer\Common\Sheet The "external" sheet

getLastWrittenRowIndex() public method

public getLastWrittenRowIndex ( ) : integer
return integer The index of the last written row

getTableElementStartAsString() public method

Returns the table XML root node as string.
public getTableElementStartAsString ( ) : string
return string node as string

getWorksheetFilePath() public method

public getWorksheetFilePath ( ) : string
return string Path to the temporary sheet content XML file

startSheet() protected method

Prepares the worksheet to accept data The XML file does not contain the "" node as it contains the sheet's name which may change during the execution of the program. It will be added at the end.
protected startSheet ( ) : void
return void

throwIfSheetFilePointerIsNotAvailable() protected method

Checks if the book has been created. Throws an exception if not created yet.

Property Details

$externalSheet protected_oe property

The "external" sheet
protected $externalSheet

$lastWrittenRowIndex protected_oe property

Index of the last written row
protected $lastWrittenRowIndex

$maxNumColumns protected_oe property

Maximum number of columns among all the written rows
protected $maxNumColumns

$sheetFilePointer protected_oe property

Pointer to the temporary sheet data file (e.g. worksheets-temp/sheet1.xml)
protected $sheetFilePointer

$stringHelper protected_oe property

To help with string manipulation
protected $stringHelper

$stringsEscaper protected_oe property

Strings escaper
protected $stringsEscaper

$worksheetFilePath protected_oe property

Path to the XML file that will contain the sheet data
protected $worksheetFilePath