Documentation

RecordConverter extends Base
in package

Class RecordConverter.

Table of Contents

FIELD_TO_MAPPING  = 1
$cleanRecordModels  : array<string|int, Vtiger_Record_Model>
Record models of created records.
$createdRecords  : array<string|int, int>
Created records ids.
$destinyInvFields  : array<string|int, mixed>
Destiny module inventory fields.
$destinyModule  : string
Destiny module name.
$destinyModuleModel  : Vtiger_Module_Model
Destiny module model.
$error  : string
$fieldMapping  : array<string|int, mixed>|string
Convert field mapping.
$fieldMappingExecute  : bool
Variable determines the possibility of fields mapping.
$groupRecordConvert  : bool
Variable determines the type of group records.
$inventoryMapping  : array<string|int, mixed>|string
Convert inventory mapping.
$inventoryMappingExecute  : bool
Variable determines the possibility of inventory fields mapping.
$isFieldMergeExists  : bool
Variable determines if merge field exist.
$recordModels  : array<string|int, Vtiger_Record_Model>
Source record models.
$sourceInvFields  : array<string|int, mixed>
Source module inventory fields.
$sourceModule  : string
Source module name.
$sourceModuleModel  : Vtiger_Module_Model
Source module model.
$textParserValues  : array<string|int, mixed>
Contains values from text parser.
$value  : array<string|int, mixed>
__construct()  : mixed
Constructor.
checkFieldMappingFields()  : mixed
Function check mapped fields.
checkFieldMergeExist()  : mixed
Function check if merge can be execute.
checkIfDuplicateRecordExists()  : mixed
Function check if exist duplicate of records.
get()  : mixed
Function to get the value for a given key.
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.
getDestinyModules()  : array<string|int, string>
Gets destiny modules.
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).
getGroupRecords()  : array<string|int, mixed>
Function get query to group records.
getId()  : int
Gets ID.
getInstanceById()  : self
Function to get the instance of the record converter model.
getKeys()  : array<string|int, string>
Function to get keys.
getMappingFields()  : array<string|int, mixed>
Gets fields form mapping.
getModuleConverters()  : array<string|int, mixed>
Function gets module converters.
getQuery()  : Query
Function return query about module converters in view.
getQueryForDuplicate()  : Query
Function get query for searching duplicates.
getRecordModelsWithoutMerge()  : mixed
Function prepare records model.
getRecordsGroupBy()  : mixed
Function prepare records model group by field merge.
has()  : bool
Function to check if the key exists.
init()  : mixed
Function variable initializing.
initDestinyModuleValues()  : mixed
Function initializing destiny module values.
initFieldValuesAuto()  : mixed
Function set values to new record automatically.
initFieldValuesByUser()  : mixed
Function set values to new record defined by user.
isActive()  : bool
Function check if convert for module and view exist.
isAvailable()  : bool
Function check if convert for record and view is available.
isEmpty()  : bool
Function to check if the key is empty.
isPermitted()  : bool
Check permissions.
process()  : mixed
Main function of class.
processFieldMapping()  : mixed
Function prepare mapping fields.
processInventoryMapping()  : mixed
Function prepare inventory mapping.
processToEdit()  : Vtiger_Module_Model
Function to edit process.
remove()  : mixed
Function to remove the value.
saveChanges()  : mixed
Function save changes in new record models.
set()  : $this
Function to set the value for a given key.
setData()  : $this
Function to set all the values.
setFieldsMapCanExecute()  : mixed
Function check if field mapping process can be proced.
setInvMapCanExecute()  : mixed
Function check if inventory mapping process can be proced.
initInventoryValuesAuto()  : mixed
Function prepare auto inventory mapping.
initInventoryValuesByUser()  : mixed
Function prepare user inventory mapping.

Constants

Properties

$createdRecords

Created records ids.

public array<string|int, int> $createdRecords = []

$destinyInvFields

Destiny module inventory fields.

public array<string|int, mixed> $destinyInvFields = []

$destinyModule

Destiny module name.

public string $destinyModule = ''

$destinyModuleModel

Destiny module model.

public Vtiger_Module_Model $destinyModuleModel

$fieldMapping

Convert field mapping.

public array<string|int, mixed>|string $fieldMapping

$fieldMappingExecute

Variable determines the possibility of fields mapping.

public bool $fieldMappingExecute = false

$groupRecordConvert

Variable determines the type of group records.

public bool $groupRecordConvert = false

$inventoryMapping

Convert inventory mapping.

public array<string|int, mixed>|string $inventoryMapping

$inventoryMappingExecute

Variable determines the possibility of inventory fields mapping.

public bool $inventoryMappingExecute = false

$isFieldMergeExists

Variable determines if merge field exist.

public bool $isFieldMergeExists = false

$sourceInvFields

Source module inventory fields.

public array<string|int, mixed> $sourceInvFields = []

$sourceModuleModel

Source module model.

public Vtiger_Module_Model $sourceModuleModel

$textParserValues

Contains values from text parser.

public array<string|int, mixed> $textParserValues = []

$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

checkFieldMappingFields()

Function check mapped fields.

public checkFieldMappingFields() : mixed
Return values
mixed

checkFieldMergeExist()

Function check if merge can be execute.

public checkFieldMergeExist() : mixed
Return values
mixed

checkIfDuplicateRecordExists()

Function check if exist duplicate of records.

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

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>

getDestinyModules()

Gets destiny modules.

public getDestinyModules() : array<string|int, string>
Return values
array<string|int, 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

getGroupRecords()

Function get query to group records.

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

getInstanceById()

Function to get the instance of the record converter model.

public static getInstanceById(int $id[, string $moduleName = '' ]) : self
Parameters
$id : int
$moduleName : string = ''
Return values
self

getKeys()

Function to get keys.

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

getMappingFields()

Gets fields form mapping.

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

getModuleConverters()

Function gets module converters.

public static getModuleConverters(string $moduleName[, string $view = '' ][, array<string|int, mixed> $recordIds = [] ][, int|null $userId = null ]) : array<string|int, mixed>
Parameters
$moduleName : string
$view : string = ''
$recordIds : array<string|int, mixed> = []
$userId : int|null = null
Return values
array<string|int, mixed>

getQuery()

Function return query about module converters in view.

public static getQuery(int|string $moduleName[, string $view = '' ]) : Query
Parameters
$moduleName : int|string
$view : string = ''
Return values
Query

getQueryForDuplicate()

Function get query for searching duplicates.

public getQueryForDuplicate() : Query
Return values
Query

getRecordModelsWithoutMerge()

Function prepare records model.

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

getRecordsGroupBy()

Function prepare records model group by field merge.

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

has()

Function to check if the key exists.

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

initDestinyModuleValues()

Function initializing destiny module values.

public initDestinyModuleValues(string $moduleName) : mixed
Parameters
$moduleName : string
Return values
mixed

initFieldValuesAuto()

Function set values to new record automatically.

public initFieldValuesAuto() : mixed
Return values
mixed

initFieldValuesByUser()

Function set values to new record defined by user.

public initFieldValuesByUser() : mixed
Return values
mixed

isActive()

Function check if convert for module and view exist.

public static isActive(int|string $moduleName[, string $view = '' ]) : bool
Parameters
$moduleName : int|string
$view : string = ''
Return values
bool

isAvailable()

Function check if convert for record and view is available.

public static isAvailable(Vtiger_Record_Model $recordModel[, string $view = '' ][, int|null $userId = null ]) : bool
Parameters
$recordModel : Vtiger_Record_Model
$view : string = ''
$userId : int|null = null
Return values
bool

isEmpty()

Function to check if the key is empty.

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

isPermitted()

Check permissions.

public isPermitted(int $recordId) : bool
Parameters
$recordId : int
Return values
bool

process()

Main function of class.

public process(array<string|int, mixed> $records) : mixed
Parameters
$records : array<string|int, mixed>
Tags
throws
AppException
Return values
mixed

processFieldMapping()

Function prepare mapping fields.

public processFieldMapping() : mixed
Return values
mixed

processInventoryMapping()

Function prepare inventory mapping.

public processInventoryMapping() : mixed
Return values
mixed

processToEdit()

Function to edit process.

public processToEdit(int $record, string $destinyModule) : Vtiger_Module_Model
Parameters
$record : int
$destinyModule : string
Tags
throws
AppException
Return values
Vtiger_Module_Model

remove()

Function to remove the value.

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

saveChanges()

Function save changes in new record models.

public saveChanges() : mixed
Return values
mixed

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

setFieldsMapCanExecute()

Function check if field mapping process can be proced.

public setFieldsMapCanExecute(int $recordsAmount) : mixed
Parameters
$recordsAmount : int
Return values
mixed

setInvMapCanExecute()

Function check if inventory mapping process can be proced.

public setInvMapCanExecute() : mixed
Return values
mixed

initInventoryValuesAuto()

Function prepare auto inventory mapping.

private initInventoryValuesAuto() : mixed
Return values
mixed

initInventoryValuesByUser()

Function prepare user inventory mapping.

private initInventoryValuesByUser() : mixed
Return values
mixed

        

Search results