Vtiger_MultiAttachment_UIType
extends Vtiger_Base_UIType
in package
UIType Multi Attachment Field Class.
Table of Contents
- FILE_ACTION_NAME = 'MultiAttachment'
- LIMIT = 3
- $ajaxEditable : bool
- $search : bool
- $sortable : bool
- $validate : array<string|int, mixed>
- $value : array<string|int, mixed>
- $writable : bool
- __construct() : mixed
- Constructor.
- convertToSave() : mixed
- Convert value before writing to the database.
- delete() : void
- Function for deleting specific data for uiType.
- duplicateValueFromRecord() : bool
- Duplicate value from record.
- get() : mixed
- Function to get the value for a given key.
- getAcceptFormats() : string
- Provide a filter in the file select dialog box.
- getAllowedColumnTypes() : array<string|int, string>|null
- Returns allowed types of columns in database.
- getApiDisplayValue() : mixed
- Function to get display value for Web Service API.
- getApiEditValue() : mixed
- Function to get edit value for Web Service API.
- getArray() : array<string|int, mixed>
- Function to get the array values for a given key.
- getConditionBuilderField() : Vtiger_Field_Model
- Function to get the field model for condition builder.
- getData() : array<string|int, mixed>
- Function to get all the values of the Object.
- getDbConditionBuilderValue() : string
- Function to get the DB Insert Value, for the current field type with given User Value for condition builder.
- getDBValue() : mixed
- Function to get the DB Insert Value, for the current field type with given User Value.
- getDefaultEditTemplateName() : string
- Function to get the default edit view template name for the current UI Type Object.
- getDefaultValue() : mixed
- Function to get Default Field Value.
- getDetailViewTemplateName() : string
- Function to get the Detailview template name for the current UI Type Object.
- getDisplayValue() : mixed
- Function to get the display value, for the current field type with given DB Insert Value.
- getDuplicateValue() : string
- Duplicate value from record.
- getEditViewDisplayValue() : mixed
- Function to get the edit value in display view.
- getEditViewValue() : mixed
- Function to get the edit value.
- getFieldInfo() : array<string|int, mixed>
- Function to get the field details.
- getFieldModel() : Vtiger_Field_Model
- Get field model instance.
- getFileUrl() : string
- Get file url.
- 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).
- getHeaderTypes() : array<string|int, string>
- Gets header types.
- getHistoryDisplayValue() : mixed
- Function to get display value for ModTracker.
- getInstanceFromField() : self
- Static function to get the UIType object from Vtiger Field Model.
- getKeys() : array<string|int, string>
- Function to get keys.
- getListSearchTemplateName() : string
- Function to get the Template name for the current UI Type object.
- getListViewDisplayValue() : mixed
- Function to get the list value in display view.
- getOperatorTemplateName() : string
- Returns template for operator.
- getQueryOperators() : array<string|int, string>
- Return allowed query operators for field.
- getRawValue() : mixed
- Function to get raw data value.
- getRecordOperators() : array<string|int, string>
- Return allowed record operators for field.
- getRelatedListDisplayValue() : string
- Function to get Display value for RelatedList.
- getRelatedListViewDisplayValue() : mixed
- Function to get the related list value in display view.
- getStorageFileDir() : string
- Get storage file sufix directory.
- getTemplateName() : string
- Function to get the Template name for the current UI Type Object.
- getTextParserDisplayValue() : mixed
- Function to get display value for TextParser.
- getTilesDisplayValue() : string
- Function to get the tile value in display view.
- getValueEncoded() : string
- Get value as string in JSON format.
- getValueFromImport() : mixed
- Gets value from import.
- getValueToExport() : mixed
- Gets value to export.
- has() : bool
- Function to check if the key exists.
- isActiveSearchView() : bool
- If the field is active in search.
- isAjaxEditable() : bool
- If the field is editable by ajax.
- isDuplicable() : bool
- Function determines whether the field value can be duplicated.
- isEmpty() : bool
- Function to check if the key is empty.
- isListviewSortable() : bool
- If the field is sortable in ListView.
- isWritable() : bool
- Function to check whether the current field is writable.
- remove() : mixed
- Function to remove the value.
- saveFromBase() : array<string|int, mixed>
- Save file from base64 encoded string.
- set() : $this
- Function to set the value for a given key.
- setData() : $this
- Function to set all the values.
- setDefaultValueFromRequest() : mixed
- Set default value from request.
- setValueFromRequest() : mixed
- Set value from request.
- updateUploadFiles() : void
- Update upload files.
- uploadTempFile() : array<string|int, mixed>
- Upload and save attachment.
- validate() : mixed
- Verification of data.
- validateValue() : mixed
- Verification of value.
Constants
FILE_ACTION_NAME
public
string
FILE_ACTION_NAME
= 'MultiAttachment'
Name of the action to handle the files
LIMIT
public
int
LIMIT
= 3
Default attachments limit.
Properties
$ajaxEditable
protected
bool
$ajaxEditable
= \true
Field is editable from Detail View
$search
protected
bool
$search
= \true
Search allowed
$sortable
protected
bool
$sortable
= \true
Sorting allowed
$validate
protected
array<string|int, mixed>
$validate
= []
Verify the value.
$value
protected
array<string|int, mixed>
$value
Values
$writable
protected
bool
$writable
= \true
Field is writable
Methods
__construct()
Constructor.
public
__construct([array<string|int, mixed> $values = [] ]) : mixed
Parameters
- $values : array<string|int, mixed> = []
Return values
mixed —convertToSave()
Convert value before writing to the database.
public
convertToSave(mixed $value, Vtiger_Record_Model $recordModel) : mixed
Parameters
- $value : mixed
- $recordModel : Vtiger_Record_Model
Return values
mixed —delete()
Function for deleting specific data for uiType.
public
delete() : void
Return values
void —duplicateValueFromRecord()
Duplicate value from record.
public
duplicateValueFromRecord(array<string|int, mixed> &$value, Request $request) : bool
Parameters
- $value : array<string|int, mixed>
- $request : Request
Tags
Return values
bool —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
getAcceptFormats()
Provide a filter in the file select dialog box.
public
getAcceptFormats() : string
Return values
string —getAllowedColumnTypes()
Returns allowed types of columns in database.
public
getAllowedColumnTypes() : array<string|int, string>|null
Return values
array<string|int, string>|null —getApiDisplayValue()
Function to get display value for Web Service API.
public
getApiDisplayValue(mixed $value, Vtiger_Record_Model $recordModel[, array<string|int, mixed> $params = [] ]) : mixed
Parameters
- $value : mixed
- $recordModel : Vtiger_Record_Model
- $params : array<string|int, mixed> = []
Return values
mixed —getApiEditValue()
Function to get edit value for Web Service API.
public
getApiEditValue( $value) : mixed
Parameters
Return values
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> —getConditionBuilderField()
Function to get the field model for condition builder.
public
getConditionBuilderField(string $operator) : Vtiger_Field_Model
Parameters
- $operator : string
Return values
Vtiger_Field_Model —getData()
Function to get all the values of the Object.
public
getData() : array<string|int, mixed>
Return values
array<string|int, mixed> —getDbConditionBuilderValue()
Function to get the DB Insert Value, for the current field type with given User Value for condition builder.
public
getDbConditionBuilderValue(mixed $value, string $operator) : string
Parameters
- $value : mixed
- $operator : string
Return values
string —getDBValue()
Function to get the DB Insert Value, for the current field type with given User Value.
public
getDBValue(mixed $value[, mixed $recordModel = false ]) : mixed
Parameters
- $value : mixed
- $recordModel : mixed = false
Return values
mixed —getDefaultEditTemplateName()
Function to get the default edit view template name for the current UI Type Object.
public
getDefaultEditTemplateName() : string
Return values
string —- Template Name
getDefaultValue()
Function to get Default Field Value.
public
getDefaultValue() : mixed
Tags
Return values
mixed —getDetailViewTemplateName()
Function to get the Detailview template name for the current UI Type Object.
public
getDetailViewTemplateName() : string
Return values
string —- Template Name
getDisplayValue()
Function to get the display value, for the current field type with given DB Insert Value.
public
getDisplayValue(mixed $value[, mixed $record = false ][, mixed $recordModel = false ][, mixed $rawText = false ][, mixed $length = false ]) : mixed
Parameters
- $value : mixed
-
Field value
- $record : mixed = false
-
Record Id
- $recordModel : mixed = false
- $rawText : mixed = false
-
Return text or html
- $length : mixed = false
-
Length of the text
Return values
mixed —getDuplicateValue()
Duplicate value from record.
public
getDuplicateValue(Vtiger_Record_Model $recordModel) : string
Parameters
- $recordModel : Vtiger_Record_Model
Tags
Return values
string —getEditViewDisplayValue()
Function to get the edit value in display view.
public
getEditViewDisplayValue(mixed $value[, mixed $recordModel = false ]) : mixed
Parameters
- $value : mixed
- $recordModel : mixed = false
Return values
mixed —getEditViewValue()
Function to get the edit value.
public
getEditViewValue(mixed $value[, Vtiger_Record_Model $recordModel = false ]) : mixed
Parameters
- $value : mixed
- $recordModel : Vtiger_Record_Model = false
Return values
mixed —getFieldInfo()
Function to get the field details.
public
getFieldInfo() : array<string|int, mixed>
Return values
array<string|int, mixed> —getFieldModel()
Get field model instance.
public
getFieldModel() : Vtiger_Field_Model
Return values
Vtiger_Field_Model —getFileUrl()
Get file url.
public
getFileUrl(string $key, int $record) : string
Parameters
- $key : string
- $record : int
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
getHeaderTypes()
Gets header types.
public
getHeaderTypes() : array<string|int, string>
Return values
array<string|int, string> —getHistoryDisplayValue()
Function to get display value for ModTracker.
public
getHistoryDisplayValue(mixed $value, Vtiger_Record_Model $recordModel[, mixed $rawText = false ]) : mixed
Parameters
- $value : mixed
- $recordModel : Vtiger_Record_Model
- $rawText : mixed = false
Return values
mixed —getInstanceFromField()
Static function to get the UIType object from Vtiger Field Model.
public
static getInstanceFromField(Vtiger_Field_Model $fieldModel) : self
Parameters
- $fieldModel : Vtiger_Field_Model
Return values
self —Vtiger_Base_UIType or UIType specific object instance
getKeys()
Function to get keys.
public
getKeys() : array<string|int, string>
Return values
array<string|int, string> —getListSearchTemplateName()
Function to get the Template name for the current UI Type object.
public
getListSearchTemplateName() : string
Return values
string —- Template Name
getListViewDisplayValue()
Function to get the list value in display view.
public
getListViewDisplayValue(mixed $value[, int $record = false ][, bool|Vtiger_Record_Model $recordModel = false ][, bool $rawText = false ]) : mixed
Parameters
- $value : mixed
-
Field value
- $record : int = false
-
|bool Record Id
- $recordModel : bool|Vtiger_Record_Model = false
- $rawText : bool = false
-
Return text or html
Return values
mixed —getOperatorTemplateName()
Returns template for operator.
public
getOperatorTemplateName([string $operator = '' ]) : string
Parameters
- $operator : string = ''
Return values
string —getQueryOperators()
Return allowed query operators for field.
public
getQueryOperators() : array<string|int, string>
Return values
array<string|int, string> —getRawValue()
Function to get raw data value.
public
getRawValue(mixed $value) : mixed
Parameters
- $value : mixed
Return values
mixed —getRecordOperators()
Return allowed record operators for field.
public
getRecordOperators() : array<string|int, string>
Return values
array<string|int, string> —getRelatedListDisplayValue()
Function to get Display value for RelatedList.
public
getRelatedListDisplayValue(string $value) : string
Parameters
- $value : string
Return values
string —getRelatedListViewDisplayValue()
Function to get the related list value in display view.
public
getRelatedListViewDisplayValue(mixed $value[, int $record = false ][, bool|Vtiger_Record_Model $recordModel = false ][, bool $rawText = false ]) : mixed
Parameters
- $value : mixed
-
Field value
- $record : int = false
-
|bool Record Id
- $recordModel : bool|Vtiger_Record_Model = false
- $rawText : bool = false
-
Return text or html
Return values
mixed —getStorageFileDir()
Get storage file sufix directory.
public
getStorageFileDir() : string
Return values
string —getTemplateName()
Function to get the Template name for the current UI Type Object.
public
getTemplateName() : string
Return values
string —- Template Name
getTextParserDisplayValue()
Function to get display value for TextParser.
public
getTextParserDisplayValue(mixed $value, Vtiger_Record_Model $recordModel, mixed $params) : mixed
Parameters
- $value : mixed
- $recordModel : Vtiger_Record_Model
- $params : mixed
Return values
mixed —getTilesDisplayValue()
Function to get the tile value in display view.
public
getTilesDisplayValue(mixed $value[, bool|int $record = false ][, bool|Vtiger_Record_Model $recordModel = false ][, bool $rawText = false ]) : string
Parameters
- $value : mixed
- $record : bool|int = false
- $recordModel : bool|Vtiger_Record_Model = false
- $rawText : bool = false
Return values
string —getValueEncoded()
Get value as string in JSON format.
public
getValueEncoded(string $value, int|null $record) : string
Parameters
- $value : string
- $record : int|null
Return values
string —getValueFromImport()
Gets value from import.
public
getValueFromImport(mixed $value[, mixed $defaultValue = null ]) : mixed
Parameters
- $value : mixed
- $defaultValue : mixed = null
Return values
mixed —getValueToExport()
Gets value to export.
public
getValueToExport(mixed $value, int $recordId) : mixed
Parameters
- $value : mixed
- $recordId : int
Return values
mixed —has()
Function to check if the key exists.
public
has(string $key) : bool
Parameters
- $key : string
Return values
bool —isActiveSearchView()
If the field is active in search.
public
isActiveSearchView() : bool
Return values
bool —isAjaxEditable()
If the field is editable by ajax.
public
isAjaxEditable() : bool
Return values
bool —isDuplicable()
Function determines whether the field value can be duplicated.
public
isDuplicable() : bool
Return values
bool —isEmpty()
Function to check if the key is empty.
public
isEmpty(string $key) : bool
Parameters
- $key : string
Return values
bool —isListviewSortable()
If the field is sortable in ListView.
public
isListviewSortable() : bool
Return values
bool —isWritable()
Function to check whether the current field is writable.
public
isWritable() : bool
Return values
bool —remove()
Function to remove the value.
public
remove(string $key) : mixed
Parameters
- $key : string
Return values
mixed —saveFromBase()
Save file from base64 encoded string.
public
saveFromBase(string $raw) : array<string|int, mixed>
Parameters
- $raw : string
-
base64 string
Return values
array<string|int, 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 —setDefaultValueFromRequest()
Set default value from request.
public
setDefaultValueFromRequest(Request $request) : mixed
Parameters
- $request : Request
Tags
Return values
mixed —setValueFromRequest()
Set value from request.
public
setValueFromRequest(Request $request, Vtiger_Record_Model $recordModel[, mixed $requestFieldName = false ]) : mixed
Parameters
- $request : Request
- $recordModel : Vtiger_Record_Model
- $requestFieldName : mixed = false
Return values
mixed —updateUploadFiles()
Update upload files.
public
updateUploadFiles(array<string|int, mixed> $value, Vtiger_Record_Model $recordModel) : void
Parameters
- $value : array<string|int, mixed>
- $recordModel : Vtiger_Record_Model
Return values
void —uploadTempFile()
Upload and save attachment.
public
uploadTempFile(array<string|int, mixed> $files, int $recordId) : array<string|int, mixed>
Parameters
- $files : array<string|int, mixed>
- $recordId : int
Return values
array<string|int, mixed> —validate()
Verification of data.
public
validate(mixed $value[, mixed $isUserFormat = false ]) : mixed
Parameters
- $value : mixed
- $isUserFormat : mixed = false
Return values
mixed —validateValue()
Verification of value.
public
validateValue(mixed $value) : mixed
Parameters
- $value : mixed