Documentation

ExportModel extends Model
in package

Model used for exporting data

Tags
author

Alexey Bobkov, Samuel Georges

Table of Contents

download()  : void
Download a previously compiled export file.
export()  : mixed
Export data based on column names and labels.
exportData()  : mixed
Called when data is being exported.
encodeArrayValue()  : string
Implodes a single dimension array using pipes (|) Multi dimensional arrays are not allowed.
exportExtendColumns()  : mixed
Used to override column definitions at export time.
getColumnHeaders()  : mixed
Extracts the headers from the column definitions.
matchDataToColumns()  : mixed
Ensures the correct order of the column data.
processExportData()  : mixed
Converts a data collection to a CSV file.

Methods

download()

Download a previously compiled export file.

public download(mixed $name[, mixed $outputName = null ]) : void
Parameters
$name : mixed
$outputName : mixed = null
Return values
void

export()

Export data based on column names and labels.

public export(mixed $columns, mixed $options) : mixed

The $columns array should be in the format of:

[ 'db_name1' => 'Column label', 'db_name2' => 'Another label', ... ]

Parameters
$columns : mixed
$options : mixed
Return values
mixed

exportData()

Called when data is being exported.

public abstract exportData(mixed $columns[, mixed $sessionKey = null ]) : mixed

The return value should be an array in the format of:

[ 'db_name1' => 'Some attribute value', 'db_name2' => 'Another attribute value' ], [...]

Parameters
$columns : mixed
$sessionKey : mixed = null
Return values
mixed

encodeArrayValue()

Implodes a single dimension array using pipes (|) Multi dimensional arrays are not allowed.

protected encodeArrayValue(mixed $data[, mixed $delimeter = '|' ]) : string
Parameters
$data : mixed
$delimeter : mixed = '|'
Return values
string

exportExtendColumns()

Used to override column definitions at export time.

protected exportExtendColumns(mixed $columns) : mixed
Parameters
$columns : mixed
Return values
mixed

getColumnHeaders()

Extracts the headers from the column definitions.

protected getColumnHeaders(mixed $columns) : mixed
Parameters
$columns : mixed
Return values
mixed

matchDataToColumns()

Ensures the correct order of the column data.

protected matchDataToColumns(mixed $data, mixed $columns) : mixed
Parameters
$data : mixed
$columns : mixed
Return values
mixed

processExportData()

Converts a data collection to a CSV file.

protected processExportData(mixed $columns, mixed $results, mixed $options) : mixed
Parameters
$columns : mixed
$results : mixed
$options : mixed
Return values
mixed

Search results