Documentation

Vtiger_ExportToCsv_Model extends ExportRecords
in package

Export to csv - class.

Table of Contents

$exportColumns  : array<string|int, mixed>
$fileExtension  : string
$focus  : CRMEntity
$moduleFieldInstances  : array<string|int, Vtiger_Field_Model>
$moduleInstance  : Vtiger_Module_Model
$moduleName  : string
$picklistValues  : array<string|int, mixed>
$queryOptions  : array<string|int, mixed>
$quickExport  : bool
$recordsListFromRequest  : int
$relatedModuleFields  : array<string|int, Vtiger_Field_Model>
$value  : array<string|int, mixed>
__construct()  : mixed
Constructor.
exportData()  : void
Function exports the data based on the mode.
get()  : mixed
Function to get the value for a given key.
getAllModuleFieldsAsHeaders()  : array<string|int, mixed>
Function returns all module fields as headers.
getAllModuleFieldsForQuery()  : array<string|int, mixed>
Function returns all module fields for query.
getArray()  : array<string|int, mixed>
Function to get the array values for a given key.
getData()  : array<string|int, mixed>
Function to get all the values of the Object.
getEntriesExport()  : array<string|int, mixed>
getEntriesForQuickExport()  : array<string|int, mixed>
getExportContentType()  : string
Function returns the export type - This can be extended to support different file exports.
getExportQuery()  : Query
Function that generates Export Query based on the mode.
getFieldsForExportQuery()  : array<string|int, mixed>
Function return fields for export query by a specific method.
getFieldsSelectedByUserForQuery()  : array<string|int, mixed>
Function returns module fields selected by user.
getFileName()  : string
getForHtml()  : mixed
Function to get the html encoded value for a given key.
getForSql()  : mixed
Function to get the value if its safe to use for SQL Query (column).
getHeaderLabelForField()  : string
Function returns heder label for the field.
getHeaders()  : array<string|int, mixed>
Get file headers.
getHeadersFromCurrentView()  : array<string|int, mixed>
Function returns headers specified in current filter.
getHeadersSelectedByUser()  : array<string|int, mixed>
Function returns headers for file selected by user.
getInstance()  : self
Get instance.
getInstanceFromRequest()  : self
Get instance from request.
getKeys()  : array<string|int, string>
Function to get keys.
getRecordDataInExportFormat()  : array<string|int, mixed>
Function returns record data in export format.
getRecordDataInUserFormat()  : array<string|int, mixed>
Get data from record in display format.
getSupportedFileFormats()  : array<string|int, mixed>
Get supported file formats.
has()  : bool
Function to check if the key exists.
initializeFromRequest()  : mixed
Initialize from request.
isEmpty()  : bool
Function to check if the key is empty.
listValueForExport()  : string
Get list value from related fields.
output()  : mixed
Function that create the exported file.
remove()  : mixed
Function to remove the value.
sanitizeInventoryValues()  : array<string|int, mixed>
Sanitize inventory values.
sanitizeValues()  : array<string|int, mixed>
This function takes in an array of values for an user and sanitizes it for export Requires modification after adding a new field type.
sendHttpHeader()  : void
Send HTTP Header.
set()  : $this
Function to set the value for a given key.
setData()  : $this
Function to set all the values.
setRecordList()  : array<string|int, mixed>
Function set id's of records from list.
setReferenceField()  : mixed
Function sets module reference field.

Properties

$exportColumns

protected array<string|int, mixed> $exportColumns = []

Columns selected by user

$fileExtension

protected string $fileExtension = 'csv'

File extension.

$moduleFieldInstances

protected array<string|int, Vtiger_Field_Model> $moduleFieldInstances

Field model instance.

$moduleInstance

protected Vtiger_Module_Model $moduleInstance

Module model.

$picklistValues

protected array<string|int, mixed> $picklistValues

Picklist values

$queryOptions

protected array<string|int, mixed> $queryOptions

Query options

$quickExport

protected bool $quickExport = false

If is quick export

$recordsListFromRequest

protected int $recordsListFromRequest = []

Record from list

$relatedModuleFields

protected array<string|int, Vtiger_Field_Model> $relatedModuleFields = []

Field from related modules

$value

protected array<string|int, mixed> $value

Values

Methods

__construct()

Constructor.

public __construct([array<string|int, mixed> $values = [] ]) : mixed
Parameters
$values : array<string|int, mixed> = []
Return values
mixed

exportData()

Function exports the data based on the mode.

public exportData() : void
Return values
void

get()

Function to get the value for a given key.

public get(string $key) : mixed
Parameters
$key : string
Return values
mixed

Value for the given key

getAllModuleFieldsAsHeaders()

Function returns all module fields as headers.

public getAllModuleFieldsAsHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>

getAllModuleFieldsForQuery()

Function returns all module fields for query.

public getAllModuleFieldsForQuery() : array<string|int, mixed>
Return values
array<string|int, mixed>

getArray()

Function to get the array values for a given key.

public getArray(string $key[, array<string|int, mixed> $value = [] ]) : array<string|int, mixed>
Parameters
$key : string
$value : array<string|int, mixed> = []
Return values
array<string|int, mixed>

getData()

Function to get all the values of the Object.

public getData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getEntriesExport()

public getEntriesExport() : array<string|int, mixed>
Return values
array<string|int, mixed>

getEntriesForQuickExport()

public getEntriesForQuickExport() : array<string|int, mixed>
Return values
array<string|int, mixed>

getExportContentType()

Function returns the export type - This can be extended to support different file exports.

public getExportContentType() : string
Return values
string

getExportQuery()

Function that generates Export Query based on the mode.

public getExportQuery() : Query
Tags
throws
Exception
Return values
Query

getFieldsForExportQuery()

Function return fields for export query by a specific method.

public getFieldsForExportQuery() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFieldsSelectedByUserForQuery()

Function returns module fields selected by user.

public getFieldsSelectedByUserForQuery() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFileName()

public getFileName() : string
Return values
string

getForHtml()

Function to get the html encoded value for a given key.

public getForHtml(string $key) : mixed
Parameters
$key : string
Return values
mixed

getForSql()

Function to get the value if its safe to use for SQL Query (column).

public getForSql(string $key[, bool $skipEmtpy = true ]) : mixed
Parameters
$key : string
$skipEmtpy : bool = true

Skip the check if string is empty

Return values
mixed

Value for the given key

getHeaderLabelForField()

Function returns heder label for the field.

public getHeaderLabelForField(string $fieldName, string $moduleName, string|null $referenceField, bool $exportBlockName) : string
Parameters
$fieldName : string
$moduleName : string
$referenceField : string|null
$exportBlockName : bool
Return values
string

getHeaders()

Get file headers.

public getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>

getHeadersFromCurrentView()

Function returns headers specified in current filter.

public getHeadersFromCurrentView() : array<string|int, mixed>
Return values
array<string|int, mixed>

getHeadersSelectedByUser()

Function returns headers for file selected by user.

public getHeadersSelectedByUser() : array<string|int, mixed>
Return values
array<string|int, mixed>

getInstance()

Get instance.

public static getInstance(string $moduleName[, string $exportType = 'csv' ]) : self
Parameters
$moduleName : string
$exportType : string = 'csv'
Return values
self

getInstanceFromRequest()

Get instance from request.

public static getInstanceFromRequest(Request $request) : self
Parameters
$request : Request
Return values
self

getKeys()

Function to get keys.

public getKeys() : array<string|int, string>
Return values
array<string|int, string>

getRecordDataInExportFormat()

Function returns record data in export format.

public getRecordDataInExportFormat(array<string|int, mixed> $recordValues) : array<string|int, mixed>
Parameters
$recordValues : array<string|int, mixed>
Return values
array<string|int, mixed>

getRecordDataInUserFormat()

Get data from record in display format.

public getRecordDataInUserFormat(array<string|int, mixed> $recordValues) : array<string|int, mixed>
Parameters
$recordValues : array<string|int, mixed>
Return values
array<string|int, mixed>

getSupportedFileFormats()

Get supported file formats.

public static getSupportedFileFormats(string $moduleName) : array<string|int, mixed>
Parameters
$moduleName : string
Return values
array<string|int, mixed>

has()

Function to check if the key exists.

public has(string $key) : bool
Parameters
$key : string
Return values
bool

isEmpty()

Function to check if the key is empty.

public isEmpty(string $key) : bool
Parameters
$key : string
Return values
bool

listValueForExport()

Get list value from related fields.

public listValueForExport(Vtiger_Field_Model $field, bool $rawText, Vtiger_Record_Model $record) : string
Parameters
$field : Vtiger_Field_Model
$rawText : bool
$record : Vtiger_Record_Model
Return values
string

output()

Function that create the exported file.

public output(array<string|int, mixed> $headers, array<string|int, mixed> $entries) : mixed
Parameters
$headers : array<string|int, mixed>
  • output file header
$entries : array<string|int, mixed>
  • output file data
Return values
mixed

remove()

Function to remove the value.

public remove(string $key) : mixed
Parameters
$key : string
Return values
mixed

sanitizeInventoryValues()

Sanitize inventory values.

public sanitizeInventoryValues(array<string|int, mixed> $inventoryRow, array<string|int, mixed> $inventoryFields) : array<string|int, mixed>
Parameters
$inventoryRow : array<string|int, mixed>
$inventoryFields : array<string|int, mixed>
Return values
array<string|int, mixed>

sanitizeValues()

This function takes in an array of values for an user and sanitizes it for export Requires modification after adding a new field type.

public sanitizeValues(array<string|int, mixed> $recordValues) : array<string|int, mixed>
Parameters
$recordValues : array<string|int, mixed>
Return values
array<string|int, mixed>

sendHttpHeader()

Send HTTP Header.

public sendHttpHeader() : void
Return values
void

set()

Function to set the value for a given key.

public set(string $key, mixed $value) : $this
Parameters
$key : string
$value : mixed
Return values
$this

setData()

Function to set all the values.

public setData(mixed $values) : $this
Parameters
$values : mixed
Return values
$this

setRecordList()

Function set id's of records from list.

public setRecordList(array<string|int, mixed> $listId) : array<string|int, mixed>
Parameters
$listId : array<string|int, mixed>
Return values
array<string|int, mixed>

setReferenceField()

Function sets module reference field.

public setReferenceField(string $relatedFieldName, string $relatedModule, string $referenceField) : mixed
Parameters
$relatedFieldName : string
$relatedModule : string
$referenceField : string
Return values
mixed

        

Search results