Semantic MediaWiki and related extensions
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
SRF\SpreadsheetPrinter Class Reference
Inheritance diagram for SRF\SpreadsheetPrinter:
Inheritance graph
[legend]
Collaboration diagram for SRF\SpreadsheetPrinter:
Collaboration graph
[legend]

Public Member Functions

 getMimeType (SMWQueryResult $queryResult)
 
 getFileName (SMWQueryResult $queryResult)
 
 outputAsFile (SMWQueryResult $queryResult, array $params)
 
 getParamDefinitions (array $definitions)
 

Public Attributes

const HEADER_ROW_OFFSET = 1
 

Protected Member Functions

 getResultText (SMWQueryResult $queryResult, $outputMode)
 
 getResultFileContents (SMWQueryResult $queryResult)
 
 createSpreadsheet ()
 
 populateWorksheet (Worksheet $worksheet, SMWQueryResult $queryResult)
 
 populateHeaderRow (Row $row, SMWQueryResult $queryResult)
 
 populateRow (Row $row, $resultRow)
 
 populateCell (Cell $cell, SMWResultArray $field)
 
 populateCellAccordingToType (Cell $cell, SMWDataValue $value)
 
 setQuantityDataValue (Cell $cell, \SMWQuantityValue $value)
 
 setNumberDataValue (Cell $cell, \SMWNumberValue $value)
 
 setTimeDataValue (Cell $cell, \SMWTimeValue $value)
 
 setStringDataValue (Cell $cell, SMWDataValue $value)
 
 getStringFromSpreadsheet (Spreadsheet $spreadsheet)
 

Protected Attributes

 $fileFormats
 
 $styled = false
 
 $fileFormat
 

Detailed Description

Author
Kim Eik
Since
1.9

Member Function Documentation

◆ createSpreadsheet()

SRF\SpreadsheetPrinter::createSpreadsheet ( )
protected

Creates a new PhpSpreadsheet document and returns it

Returns
Spreadsheet
Exceptions

◆ getFileName()

SRF\SpreadsheetPrinter::getFileName ( SMWQueryResult  $queryResult)
See also
ExportPrinter::getFileName
Parameters
SMWQueryResult$queryResult
Returns
string

◆ getMimeType()

SRF\SpreadsheetPrinter::getMimeType ( SMWQueryResult  $queryResult)
See also
ExportPrinter::getMimeType()
Since
1.8
Parameters
SMWQueryResult$queryResult
Returns
string

◆ getParamDefinitions()

SRF\SpreadsheetPrinter::getParamDefinitions ( array  $definitions)
Parameters
$definitions[]
Returns
array

◆ getResultFileContents()

SRF\SpreadsheetPrinter::getResultFileContents ( SMWQueryResult  $queryResult)
protected
Parameters
SMWQueryResult$queryResult
Returns
string
Exceptions

◆ getResultText()

SRF\SpreadsheetPrinter::getResultText ( SMWQueryResult  $queryResult,
  $outputMode 
)
protected

Return serialised results in specified format.

Exceptions

◆ getStringFromSpreadsheet()

SRF\SpreadsheetPrinter::getStringFromSpreadsheet ( Spreadsheet  $spreadsheet)
protected
Parameters
Spreadsheet$spreadsheet
Returns
string
Exceptions

◆ outputAsFile()

SRF\SpreadsheetPrinter::outputAsFile ( SMWQueryResult  $queryResult,
array  $params 
)
See also
ExportPrinter::outputAsFile
Parameters
SMWQueryResult$queryResult
array$params

◆ populateCell()

SRF\SpreadsheetPrinter::populateCell ( Cell  $cell,
SMWResultArray  $field 
)
protected
Parameters
Cell$cell
SMWResultArray$field
Exceptions

◆ populateCellAccordingToType()

SRF\SpreadsheetPrinter::populateCellAccordingToType ( Cell  $cell,
SMWDataValue  $value 
)
protected

Checks the type of the value, and set's it in the sheet accordingly

Parameters
Cell$cell
SMWDataValue$value
Exceptions

◆ populateHeaderRow()

SRF\SpreadsheetPrinter::populateHeaderRow ( Row  $row,
SMWQueryResult  $queryResult 
)
protected

Populates the PhpSpreadsheet sheet with the headers from the result query

Parameters
Row$row
SMWQueryResult$queryResultThe query result
Returns
Row
Exceptions

◆ populateRow()

SRF\SpreadsheetPrinter::populateRow ( Row  $row,
  $resultRow 
)
protected

Populates the PhpSpreadsheet document with the query data

Parameters
Row$row
$resultRow
Exceptions

◆ populateWorksheet()

SRF\SpreadsheetPrinter::populateWorksheet ( Worksheet  $worksheet,
SMWQueryResult  $queryResult 
)
protected
Parameters
SMWQueryResult$queryResult
$worksheet
Exceptions

◆ setNumberDataValue()

SRF\SpreadsheetPrinter::setNumberDataValue ( Cell  $cell,
\SMWNumberValue  $value 
)
protected

Sets a numeric value at the given col,row location

Parameters
Cell$cell
\SMWNumberValue$valueSMWDataValue the raw data value object
Exceptions

◆ setQuantityDataValue()

SRF\SpreadsheetPrinter::setQuantityDataValue ( Cell  $cell,
\SMWQuantityValue  $value 
)
protected

Sets a quantity value at the given col,row location

Parameters
Cell$cell
\SMWQuantityValue$valueSMWDataValue the raw data value object
Exceptions

◆ setStringDataValue()

SRF\SpreadsheetPrinter::setStringDataValue ( Cell  $cell,
SMWDataValue  $value 
)
protected

Sets or appends a string value at the given col,row location

If there already exists a value at a given col,row location, then convert the cell to a string and append the data value. Creating a list of comma separated entries.

Parameters
Cell$cell
$valueSMWDataValue the raw data value object
Exceptions

◆ setTimeDataValue()

SRF\SpreadsheetPrinter::setTimeDataValue ( Cell  $cell,
\SMWTimeValue  $value 
)
protected

Sets a date/time value at the given col,row location

Parameters
Cell$cell
\SMWTimeValue$valuethe raw data value object
Exceptions

Member Data Documentation

◆ $fileFormats

SRF\SpreadsheetPrinter::$fileFormats
protected
Initial value:
= [
'xlsx' => [
'writer' => 'Xlsx'

The documentation for this class was generated from the following file:

About | General disclaimer | Privacy policy