Documentation

Item extends Base
in package

Picklist value item class.

Table of Contents

$changes  : array<string|int, mixed>
$close_state  : int
$color  : string
$description  : string
$fieldModel  : Settings_Picklist_Field_Model
$icon  : string
$id  : int
$name  : string
$prefix  : string
$presence  : int
$record_state  : int
$roles  : array<string|int, string>
$sortorderid  : int
$time_counting  : int
$value  : array<string|int, mixed>
$valueid  : int
__construct()  : mixed
Constructor.
delete()  : void
Delete item.
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.
getDbTypes()  : array<string|int, mixed>
Gets field datatypes.
getEditFields()  : array<string|int, mixed>
Get fields for edit.
getFieldInstanceByName()  : Vtiger_Field_Model
Get fields instance by name.
getFieldModel()  : Settings_Picklist_Field_Model
Get field model.
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).
getId()  : int
Function to get the Id.
getInstance()  : self
Get instance.
getKeys()  : array<string|int, string>
Function to get keys.
getNextSeq()  : int
Get next sequence number.
getPreviousValue()  : mixed
Get pervious value by field.
getTableName()  : string
Get table name.
getWritableFields()  : array<string|int, mixed>
Get writable fields.
has()  : bool
Function to check if the key exists.
isDeletable()  : bool
Check if item is deletable.
isDuplicateValue()  : bool
Check if picklist value exists.
isEmpty()  : bool
Function to check if the key is empty.
remove()  : mixed
Function to remove the value.
rename()  : void
Rename item value in other data.
save()  : bool
Save.
saveToDb()  : bool
Save data to database.
set()  : $this
Function to set the value for a given key.
setData()  : $this
Function to set all the values.
updateRolePermissions()  : void
Update role permissions.
validate()  : array<string|int, mixed>
Basic validation.
validateValue()  : void
Validate item data.
getValuesToSave()  : array<string|int, mixed>
Function formats data for saving.

Properties

$changes

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

Changes

$close_state

protected int $close_state

State for the record

$color

protected string $color

Color

$description

protected string $description

Description

$icon

protected string $icon

Icon

$id

protected int $id

Item ID

$name

protected string $name

Item name

$prefix

protected string $prefix

Prefix for numbering

$presence

protected int $presence = 1

Permission level

$record_state

protected int $record_state

Record state

$roles

protected array<string|int, string> $roles

Role IDs

$sortorderid

protected int $sortorderid

Sort ID

$time_counting

protected int $time_counting

Time counting

$value

protected array<string|int, mixed> $value

Values

$valueid

protected int $valueid

Item ID for role

Methods

__construct()

Constructor.

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

delete()

Delete item.

public delete(int $replaceId) : void
Parameters
$replaceId : int

Item ID

Return values
void

get()

Function to get the value for a given key.

public get(mixed $key) : mixed
Parameters
$key : mixed
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>

getDbTypes()

Gets field datatypes.

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

getEditFields()

Get fields for edit.

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

getFieldInstanceByName()

Get fields instance by name.

public getFieldInstanceByName(string $name) : Vtiger_Field_Model
Parameters
$name : string
Return values
Vtiger_Field_Model

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

getId()

Function to get the Id.

public getId() : int
Return values
int

getInstance()

Get instance.

public static getInstance(Vtiger_Field_Model $fieldModel, int|null $id) : self
Parameters
$fieldModel : Vtiger_Field_Model
$id : int|null
Return values
self

getKeys()

Function to get keys.

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

getNextSeq()

Get next sequence number.

public getNextSeq() : int
Return values
int

getPreviousValue()

Get pervious value by field.

public getPreviousValue([string $fieldName = '' ]) : mixed
Parameters
$fieldName : string = ''
Return values
mixed

getTableName()

Get table name.

public getTableName() : string
Return values
string

getWritableFields()

Get writable fields.

public getWritableFields() : array<string|int, mixed>
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

isDeletable()

Check if item is deletable.

public isDeletable() : bool
Return values
bool

isDuplicateValue()

Check if picklist value exists.

public isDuplicateValue() : bool
Return values
bool

isEmpty()

Function to check if the key is empty.

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

remove()

Function to remove the value.

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

rename()

Rename item value in other data.

public rename() : void
Return values
void

save()

Save.

public save() : bool
Return values
bool

saveToDb()

Save data to database.

public saveToDb() : bool
Return values
bool

set()

Function to set the value for a given key.

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

setData()

Function to set all the values.

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

updateRolePermissions()

Update role permissions.

public updateRolePermissions() : void
Return values
void

validate()

Basic validation.

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

validateValue()

Validate item data.

public validateValue(string $fieldName, mixed $value) : void
Parameters
$fieldName : string
$value : mixed
Return values
void

getValuesToSave()

Function formats data for saving.

private getValuesToSave() : array<string|int, mixed>
Return values
array<string|int, mixed>

        

Search results