Documentation

Vtiger_ExportToXml_Model extends Records
in package

Export to XML model class.

Table of Contents

EXPORT_FORMAT  = 0
USER_FORMAT  = 1
$fullData  : bool
$attrList  : mixed
$fields  : array<string|int, mixed>
$fileExtension  : string
$format  : bool
$headers  : array<string|int, mixed>
$inventoryFields  : mixed
$limit  : int
$moduleFieldInstances  : array<string|int, Vtiger_Field_Model>
$moduleInstance  : Vtiger_Module_Model
$moduleName  : string
$product  : mixed
$tmpXmlPath  : mixed
$tplName  : mixed
$value  : array<string|int, mixed>
__construct()  : mixed
Constructor.
createXml()  : void
Create XML file.
createXmlFromTemplate()  : mixed
exportData()  : mixed
Function exports the data.
get()  : mixed
Function to get the value for a given key.
getAllModuleFieldsAsHeaders()  : array<string|int, mixed>
Function returns all module fields as headers.
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.
getDataInExportFormat()  : array<string|int, mixed>
Function returns record data in export format.
getDataInUserFormat()  : array<string|int, mixed>
Get data from record in display format.
getDisplayValue()  : string
Get display value.
getEntriesInventory()  : array<string|int, mixed>
Function returns data from advanced block.
getExportContentType()  : string
Function returns the export type - This can be extended to support different file exports.
getExportQuery()  : Query
Function that generates Export Query object.
getFieldsForQuery()  : array<string|int, mixed>
Get fields for query.
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).
getHeaders()  : array<string|int, mixed>
Get file headers.
getInstance()  : self
Get instance.
getKeys()  : array<string|int, string>
Function to get keys.
getQueryGenerator()  : QueryGenerator
Get query generator object.
getSupportedFileFormats()  : array<string|int, mixed>
Get supported file formats.
has()  : bool
Function to check if the key exists.
isCData()  : mixed
isEmpty()  : bool
Function to check if the key is empty.
loadFieldsFromCvId()  : void
Load fields from custom view.
outputFile()  : mixed
remove()  : mixed
Function to remove the value.
sanitizeInventoryValue()  : string
Sanitize inventory 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.
setField()  : Vtiger_Field_Model|false
Set field model.
setFields()  : $this
Set.
setFormat()  : $this
Set the format of the exported data.
setLimit()  : $this
Set a limit for exported data.
setTemplate()  : $this
Set template.
outputZipFile()  : mixed

Constants

EXPORT_FORMAT

public int EXPORT_FORMAT = 0

Data export in a format that can be imported later

USER_FORMAT

public int USER_FORMAT = 1

Data export in user format

Properties

$fullData

public bool $fullData = false

Export all data

$attrList

protected mixed $attrList = ['crmfield', 'crmfieldtype', 'partvalue', 'constvalue', 'refmoule', 'spec', 'refkeyfld', 'delimiter', 'testcondition']

$fields

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

Fields for export

$fileExtension

protected string $fileExtension = 'xml'

File extension

$format

protected bool $format = self::EXPORT_FORMAT

Export all data

$headers

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

Headers field

$limit

protected int $limit

Limit of exported entries

$moduleFieldInstances

protected array<string|int, Vtiger_Field_Model> $moduleFieldInstances

Field model instance.

$moduleInstance

protected Vtiger_Module_Model $moduleInstance

Module model.

$moduleName

protected string $moduleName

Module name

$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

createXml()

Create XML file.

public createXml(array<string|int, mixed> $entries, array<string|int, mixed> $entriesInventory) : void
Parameters
$entries : array<string|int, mixed>
$entriesInventory : array<string|int, mixed>
Return values
void

createXmlFromTemplate()

public createXmlFromTemplate(mixed $entries, mixed $entriesInventory) : mixed
Parameters
$entries : mixed
$entriesInventory : mixed
Return values
mixed

exportData()

Function exports the data.

public exportData() : mixed
Return values
mixed

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>

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>

getDataInExportFormat()

Function returns record data in export format.

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

getDataInUserFormat()

Get data from record in display format.

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

getDisplayValue()

Get display value.

public getDisplayValue(Vtiger_Field_Model $fieldModel, mixed $value, int $recordId, array<string|int, mixed> $rowData[, int $length = 65000 ]) : string
Parameters
$fieldModel : Vtiger_Field_Model
$value : mixed
$recordId : int
$rowData : array<string|int, mixed>
$length : int = 65000
Return values
string

getEntriesInventory()

Function returns data from advanced block.

public getEntriesInventory(array<string|int, mixed> $recordData) : array<string|int, mixed>
Parameters
$recordData : 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 object.

public getExportQuery() : Query
Return values
Query

getFieldsForQuery()

Get fields for query.

public getFieldsForQuery() : 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

getHeaders()

Get file headers.

public getHeaders() : 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

getKeys()

Function to get keys.

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

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

isCData()

public isCData(mixed $name[, mixed $customColumns = [] ]) : mixed
Parameters
$name : mixed
$customColumns : mixed = []
Return values
mixed

isEmpty()

Function to check if the key is empty.

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

loadFieldsFromCvId()

Load fields from custom view.

public loadFieldsFromCvId(int $cvId) : void
Parameters
$cvId : int
Return values
void

outputFile()

public outputFile(mixed $fileName) : mixed
Parameters
$fileName : mixed
Return values
mixed

remove()

Function to remove the value.

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

sanitizeInventoryValue()

Sanitize inventory value.

public sanitizeInventoryValue(mixed $value, string $columnName) : string
Parameters
$value : mixed
$columnName : string
Return values
string

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

setField()

Set field model.

public setField(string $fieldName) : Vtiger_Field_Model|false
Parameters
$fieldName : string
Return values
Vtiger_Field_Model|false

setFields()

Set.

public setFields(array<string|int, mixed> $fields) : $this
Parameters
$fields : array<string|int, mixed>
Return values
$this

setFormat()

Set the format of the exported data.

public setFormat(int $format) : $this
Parameters
$format : int

self::EXPORT_FORMAT or self::USER_FORMAT

Return values
$this

setLimit()

Set a limit for exported data.

public setLimit(int $limit) : $this
Parameters
$limit : int
Return values
$this

setTemplate()

Set template.

public setTemplate(string $tplName) : $this
Parameters
$tplName : string
Return values
$this

outputZipFile()

protected outputZipFile(mixed $fileName) : mixed
Parameters
$fileName : mixed
Return values
mixed

        

Search results