package Gems
subpackage Export
copyright Copyright (c) 2015 Erasmus MC
license New BSD License
since Class available since version 1.7.1

 Methods

Add an export command with specific details. Can be batched.

addExport(array $data, array $modelId = false

Parameters

$data

array

Data submitted by export form

$modelId

array

Model Id when multiple models are passed

Add a footer to a specific file

addFooter(string $filename) 

Parameters

$filename

string

The temporary filename while the file is being written

Add a separate row to a file

addRow(array $row, \Gems\Export\file $file) 

Parameters

$row

array

a row in the model

$file

\Gems\Export\file

The already opened file

Add model rows to file. Can be batched

addRows(array $data, array $modelId, string $tempFilename, array $filter) 

Parameters

$data

array

Data submitted by export form

$modelId

array

Model Id when multiple models are passed

$tempFilename

string

The temporary filename while the file is being written

$filter

array

Filter (limit) to use

Finalizes the files stored in $this->files.

finalizeFiles() : \Gems\Export\File

If it has 1 file, it will return that file, if it has more, it will return a zip containing all the files, named as the first file in the array.

Returns

\Gems\Export\Filewith download headers

getDefaultFormValues()

getDefaultFormValues() : array

Returns

arrayDefault values in form

form elements for extra options for this particular export option

getFormElements(\MUtil_Form $form, array $data) : array

Parameters

$form

\MUtil_Form

Current form to add the form elements

$data

array

current options set in the form

Returns

arrayForm elements

Returns an array of ordered columnnames that have a label

getLabeledColumns() : array

Returns

arrayArray of columnnames

getName()

getName() : string

Returns

stringname of the specific export

Set the batch to be used by this source

setBatch(\Gems_Task_TaskRunnerBatch $batch) 

Use $this->hasBatch to check for existence

Parameters

$batch

\Gems_Task_TaskRunnerBatch

Creates a new file and adds it to the files array

addFile() 

Add headers to a specific file

addHeader(string $filename) 

Parameters

$filename

string

The temporary filename while the file is being written

Clean a proposed filename up so it can be used correctly as a filename

cleanupName(string $filename) : string

Parameters

$filename

string

Proposed filename

Returns

stringfiltered filename

filterDateFormat()

filterDateFormat($value, $dateFormat, $columnName) 

Parameters

$value

$dateFormat

$columnName

filterFormatFunction()

filterFormatFunction($value, $functionName) 

Parameters

$value

$functionName

filterHtml()

filterHtml($result) 

Parameters

$result

filterItemDisplay()

filterItemDisplay($value, $functionName) 

Parameters

$value

$functionName

filterMultiOptions()

filterMultiOptions($result, $multiOptions) 

Parameters

$result

$multiOptions

Filter the data in a row so that correct values are being used

filterRow(array $row) : array

Parameters

$row

array

a row in the model

Returns

arrayThe filtered row

Returns the files array. It might be stored in the batch session or normal session.

getFiles() : array

Returns

arrayFiles array

Get the model to export

getModel() : \MUtil_Model_ModelAbstract

Returns

\MUtil_Model_ModelAbstract

Get the number of items in a specific model, using the models paginator

getModelCount(array $filter = true) : integer

Parameters

$filter

array

Filter for the model

Returns

integerNumber of items in the model

Preprocess the model to add specific options

preprocessModel() 

 Properties

 

$loader

$loader : \Gems_Loader

Default

 

Own session used for non-batch exports

$_session : \Zend_Session_Namespace

Default

 

The batch object if one is set

$batch : \Gems_Task_TaskRunnerBatch

Default

 

Data submitted by export form

$data : array

Default

 

Current used file extension

$fileExtension : string

Default

 

The export file name, how it should be downloaded

$filename : string

Default

 

Array of all the filenames, new_name => temp_name

$files : array

Default

 

Model filters for export

$filter : array

Default

 

Array of the loaded first row of the model

$firstRow : array

Default

 

Current model to export

$model : \MUtil_Model_ModelAbstract

Default

 

Filter settings of the current loaded model

$modelFilter : array

Default

 

Array with the filter options that should be used for this exporter

$modelFilterAttributes : array

Default

array('multiOptions', 'formatFunction', 'dateFormat', 'storageFormat', 'itemDisplay')
 

Model Id for when multiple models are passed

$modelId : integer

Default

 

How many rows the batch will do in one go

$rowsPerBatch : integer

Default

500
 

The temporary filename while the file is being written

$tempFilename : string

Default