PHP Class Piwik\DataTable\Renderer\Xml

See the tests cases for more information about the XML format (/tests/core/DataTable/Renderer.test.php) Or have a look at the API calls examples. Works with recursive DataTable (when a row can be associated with a subDataTable).
Inheritance: extends Piwik\DataTable\Renderer
Show file Open project: piwik/piwik Class Usage Examples

Public Methods

Method Description
render ( ) : string Computes the dataTable output and returns the string/binary

Protected Methods

Method Description
getArrayFromDataTable ( DataTable | DataTable/Map $table ) : array Converts the given data table to an array
renderDataTable ( array $array, string $prefixLine = "" ) : string Computes the output for the given data array
renderDataTableMap ( Piwik\DataTable\Map $table, array $array, string $prefixLines = "" ) : string Computes the output for the given data table array
renderDataTableSimple ( $array, string $prefixLine = "" ) : string Computes the output for the given data array (representing a simple data table)
renderTable ( DataTable | DataTable/Map $table, boolean $returnOnlyDataTableXml = false, string $prefixLines = '' ) : array | string Computes the output for the given data table

Private Methods

Method Description
areTableLabelsInvalidXmlTagNames ( $rowArray )
getTagStartAndEndFor ( $keyName, $columnsHaveInvalidChars )
isValidXmlTagName ( string $str ) : boolean Returns true if a string is a valid XML tag name, false if otherwise.
renderArray ( array $array, string $prefixLines ) : string Renders an array as XML.

Method Details

getArrayFromDataTable() protected method

Converts the given data table to an array
protected getArrayFromDataTable ( DataTable | DataTable/Map $table ) : array
$table Piwik\DataTable | DataTable/Map
return array

render() public method

Computes the dataTable output and returns the string/binary
public render ( ) : string
return string

renderDataTable() protected method

Computes the output for the given data array
protected renderDataTable ( array $array, string $prefixLine = "" ) : string
$array array
$prefixLine string
return string

renderDataTableMap() protected method

Computes the output for the given data table array
protected renderDataTableMap ( Piwik\DataTable\Map $table, array $array, string $prefixLines = "" ) : string
$table Piwik\DataTable\Map
$array array
$prefixLines string
return string

renderDataTableSimple() protected method

Computes the output for the given data array (representing a simple data table)
protected renderDataTableSimple ( $array, string $prefixLine = "" ) : string
$array
$prefixLine string
return string

renderTable() protected method

Computes the output for the given data table
protected renderTable ( DataTable | DataTable/Map $table, boolean $returnOnlyDataTableXml = false, string $prefixLines = '' ) : array | string
$table Piwik\DataTable | DataTable/Map
$returnOnlyDataTableXml boolean
$prefixLines string
return array | string