Vtiger_Inventory_Model
in package
Basic Inventory Model Class.
Tags
Table of Contents
- TABLE_POSTFIX_BASE = '_invfield'
- Field configuration table postfix.
- TABLE_POSTFIX_DATA = '_inventory'
- Data table postfix.
- TABLE_POSTFIX_MAP = '_invmap'
- Field mapping table postfix.
- $fields : array<string|int, Vtiger_Basic_InventoryField>
- $moduleName : string
- $tableName : string
- createInventoryTables() : mixed
- Create inventory tables.
- deleteField() : bool
- Delete inventory field.
- getAccountDiscount() : array<string|int, mixed>
- Get discount from the account.
- getAccountTax() : array<string|int, mixed>
- Get tax from the account.
- getAllColumns() : array<string|int, astring>
- Gets all columns.
- getAutoCompleteFields() : array<string|int, mixed>
- Function return autocomplete fields.
- getCustomAutoComplete() : array<string|int, mixed>
- Function to get custom values to complete in inventory.
- getDataTableName() : string
- Gets data table name.
- getDefaultGlobalTax() : array<string|int, mixed>
- Get default global tax .
- getDiscountsConfig() : mixed
- Get discounts configuration.
- getField() : Vtiger_Basic_InventoryField|null
- Gets inventory field model.
- getFieldById() : Vtiger_Basic_InventoryField|null
- Gets inventory field model by ID.
- getFieldCleanInstance() : Vtiger_Basic_InventoryField
- Gets clean inventory field instance.
- getFields() : array<string|int, Vtiger_Basic_InventoryField>
- Gets inventory fields.
- getFieldsByBlocks() : array<string|int, mixed>
- Function that returns all the fields by blocks.
- getFieldsByType() : array<string|int, Vtiger_Basic_InventoryField>
- Gets inventory fields by type.
- getFieldsForView() : array<string|int, Vtiger_Basic_InventoryField>
- Gets the field for the view.
- getFieldsTypes() : array<string|int, Vtiger_Basic_InventoryField>
- Retrieve list of all fields.
- getGlobalDiscounts() : array<string|int, mixed>
- Get global discounts list.
- getGlobalTaxes() : array<string|int, mixed>
- Get global tax list.
- getInstance() : self
- Gets inventory instance.
- getInventoryDataById() : array<string|int, mixed>
- Function to get data of inventory for record.
- getInventoryListName() : string
- Function to get list elements in iventory as html code.
- getInventoryPrice() : float
- Gets data from record.
- getModuleName() : string
- Function returns module name.
- getPurifyTemplate() : array<string|int, mixed>
- Gets template to purify.
- getSummaryFields() : array<string|int, string>
- Getting summary fields name.
- getTableName() : string
- Gets table name.
- getTaxesConfig() : array<string|int, mixed>
- Get tax configuration.
- isField() : bool
- Checks if inventory field exists.
- loadRowData() : array<string|int, mixed>
- Load row data by record Id.
- saveField() : bool
- Save inventory field.
- saveSequence() : int
- Save sequence field.
- setFieldData() : mixed
- Sets inventory field data.
- setModuleName() : mixed
- Sets module name.
Constants
TABLE_POSTFIX_BASE
Field configuration table postfix.
private
mixed
TABLE_POSTFIX_BASE
= '_invfield'
TABLE_POSTFIX_DATA
Data table postfix.
private
mixed
TABLE_POSTFIX_DATA
= '_inventory'
TABLE_POSTFIX_MAP
Field mapping table postfix.
private
mixed
TABLE_POSTFIX_MAP
= '_invmap'
Properties
$fields
protected
array<string|int, Vtiger_Basic_InventoryField>
$fields
Inventory fields
$moduleName
protected
string
$moduleName
$tableName
protected
string
$tableName
Methods
createInventoryTables()
Create inventory tables.
public
createInventoryTables() : mixed
Return values
mixed —deleteField()
Delete inventory field.
public
deleteField(string $fieldName) : bool
Parameters
- $fieldName : string
Tags
Return values
bool —getAccountDiscount()
Get discount from the account.
public
getAccountDiscount(mixed $relatedRecord) : array<string|int, mixed>
Parameters
- $relatedRecord : mixed
Return values
array<string|int, mixed> —getAccountTax()
Get tax from the account.
public
getAccountTax(int $relatedRecord) : array<string|int, mixed>
Parameters
- $relatedRecord : int
-
Record ID
Return values
array<string|int, mixed> —getAllColumns()
Gets all columns.
public
getAllColumns() : array<string|int, astring>
Tags
Return values
array<string|int, astring> —getAutoCompleteFields()
Function return autocomplete fields.
public
getAutoCompleteFields() : array<string|int, mixed>
Return values
array<string|int, mixed> —getCustomAutoComplete()
Function to get custom values to complete in inventory.
public
getCustomAutoComplete(string $sourceFieldName, Vtiger_Record_Model $recordModel) : array<string|int, mixed>
Parameters
- $sourceFieldName : string
- $recordModel : Vtiger_Record_Model
Return values
array<string|int, mixed> —getDataTableName()
Gets data table name.
public
getDataTableName() : string
Return values
string —getDefaultGlobalTax()
Get default global tax .
public
static getDefaultGlobalTax() : array<string|int, mixed>
Return values
array<string|int, mixed> —tax list
getDiscountsConfig()
Get discounts configuration.
public
static getDiscountsConfig([string $key = '' ]) : mixed
Parameters
- $key : string = ''
Return values
mixed —config data
getField()
Gets inventory field model.
public
getField(string $fieldName) : Vtiger_Basic_InventoryField|null
Parameters
- $fieldName : string
Tags
Return values
Vtiger_Basic_InventoryField|null —getFieldById()
Gets inventory field model by ID.
public
getFieldById(int $fieldId) : Vtiger_Basic_InventoryField|null
Parameters
- $fieldId : int
Return values
Vtiger_Basic_InventoryField|null —getFieldCleanInstance()
Gets clean inventory field instance.
public
getFieldCleanInstance(string $type) : Vtiger_Basic_InventoryField
Parameters
- $type : string
Tags
Return values
Vtiger_Basic_InventoryField —getFields()
Gets inventory fields.
public
getFields() : array<string|int, Vtiger_Basic_InventoryField>
Tags
Return values
array<string|int, Vtiger_Basic_InventoryField> —getFieldsByBlocks()
Function that returns all the fields by blocks.
public
getFieldsByBlocks() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getFieldsByType()
Gets inventory fields by type.
public
getFieldsByType(string $type) : array<string|int, Vtiger_Basic_InventoryField>
Parameters
- $type : string
Tags
Return values
array<string|int, Vtiger_Basic_InventoryField> —getFieldsForView()
Gets the field for the view.
public
getFieldsForView(string $view) : array<string|int, Vtiger_Basic_InventoryField>
Parameters
- $view : string
Tags
Return values
array<string|int, Vtiger_Basic_InventoryField> —getFieldsTypes()
Retrieve list of all fields.
public
getFieldsTypes() : array<string|int, Vtiger_Basic_InventoryField>
Tags
Return values
array<string|int, Vtiger_Basic_InventoryField> —Fields instance
getGlobalDiscounts()
Get global discounts list.
public
getGlobalDiscounts() : array<string|int, mixed>
Return values
array<string|int, mixed> —discounts list
getGlobalTaxes()
Get global tax list.
public
static getGlobalTaxes() : array<string|int, mixed>
Return values
array<string|int, mixed> —tax list
getInstance()
Gets inventory instance.
public
static getInstance(string $moduleName) : self
Parameters
- $moduleName : string
Tags
Return values
self —getInventoryDataById()
Function to get data of inventory for record.
public
static getInventoryDataById(int $recordId, string $moduleName[, Vtiger_Paging_Model|null $pagingModel = null ]) : array<string|int, mixed>
Parameters
- $recordId : int
- $moduleName : string
- $pagingModel : Vtiger_Paging_Model|null = null
Tags
Return values
array<string|int, mixed> —getInventoryListName()
Function to get list elements in iventory as html code.
public
getInventoryListName(Vtiger_Record_Model $recodModel) : string
Parameters
- $recodModel : Vtiger_Record_Model
Tags
Return values
string —getInventoryPrice()
Gets data from record.
public
getInventoryPrice(Vtiger_Record_Model $recordModel) : float
Parameters
- $recordModel : Vtiger_Record_Model
Return values
float —getModuleName()
Function returns module name.
public
getModuleName() : string
Return values
string —getPurifyTemplate()
Gets template to purify.
public
getPurifyTemplate() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getSummaryFields()
Getting summary fields name.
public
getSummaryFields() : array<string|int, string>
Tags
Return values
array<string|int, string> —getTableName()
Gets table name.
public
getTableName([string $type = self::TABLE_POSTFIX_BASE ]) : string
Parameters
- $type : string = self::TABLE_POSTFIX_BASE
Return values
string —getTaxesConfig()
Get tax configuration.
public
static getTaxesConfig() : array<string|int, mixed>
Return values
array<string|int, mixed> —config data
isField()
Checks if inventory field exists.
public
isField(string $fieldName) : bool
Parameters
- $fieldName : string
Tags
Return values
bool —loadRowData()
Load row data by record Id.
public
loadRowData(int $recordId[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
Parameters
- $recordId : int
- $params : array<string|int, mixed> = []
Return values
array<string|int, mixed> —saveField()
Save inventory field.
public
saveField(Vtiger_Basic_InventoryField $fieldModel) : bool
Parameters
- $fieldModel : Vtiger_Basic_InventoryField
Tags
Return values
bool —saveSequence()
Save sequence field.
public
saveSequence(array<string|int, int> $sequenceList) : int
Parameters
- $sequenceList : array<string|int, int>
Tags
Return values
int —setFieldData()
Sets inventory field data.
public
setFieldData(Vtiger_Basic_InventoryField $fieldModel, array<string|int, mixed> $row) : mixed
Parameters
- $fieldModel : Vtiger_Basic_InventoryField
- $row : array<string|int, mixed>
Return values
mixed —setModuleName()
Sets module name.
protected
setModuleName(string $name) : mixed
Parameters
- $name : string