Settings_Profiles_Record_Model
extends Settings_Vtiger_Record_Model
in package
Profiles Record Model Class.
Table of Contents
- PROFILE_FIELD_INACTIVE = 0
- Profile field inactive.
- PROFILE_FIELD_READONLY = 1
- Profile field readonly.
- PROFILE_FIELD_READWRITE = 2
- Profile field readwrite.
- $value : array<string|int, mixed>
- $fieldLockedUiTypes : array<string|int, mixed>
- Field locked UI types.
- __construct() : mixed
- Constructor.
- delete() : mixed
- Delete record and optionally transfer assigments to other record.
- get() : mixed
- Function to get the value for a given key.
- getAll() : array<string|int, Settings_Profiles_Record_Model>
- Function to get all the profiles.
- getAllByRole() : array<string|int, Settings_Profiles_Record_Model>
- Function to get all the profiles linked to the given role.
- 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.
- getDeleteActionUrl() : string
- Function to get the Delete Action Url for the current profile.
- getDeleteAjaxUrl() : string
- Function to get the Detail Action Url for the Profile.
- getDescription() : string
- Function to get the description of the Profile.
- getDetailViewUrl() : string
- Function to get the Detail Url for the current group.
- getDisplayValue() : mixed
- Get display value.
- getDuplicateViewUrl() : string
- Function to get the Edit View Url for the Profile.
- getEditViewUrl() : string
- Function to get the Edit View Url for the Profile.
- 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).
- getGlobalPermissions() : array<string|int, mixed>
- Return global permissions.
- getId() : int
- Function to get the Id.
- getInstanceById() : Settings_Profiles_Record_Model
- Function to get the instance of Profile model, given profile id.
- getInstanceByName() : self
- Create instance by profile name.
- getKeys() : array<string|int, string>
- Function to get keys.
- getModuleFieldPermissionValue() : int
- Return module field permission value.
- getModulePermissions() : array<string|int, mixed>
- Return module permissions.
- getName() : string
- Function to get the Profile Name.
- getProfileActionPermissions() : array<string|int, mixed>
- Function to get permission for actions.
- getProfileTabFieldModel() : bool|Vtiger_Field_Model
- Return profile tab field model.
- getProfileTabFieldPermissions() : array<string|int, mixed>
- Return profile tab field permissions.
- getProfileTabModel() : bool|Vtiger_Module_Model
- Return profile tab model.
- getProfileTabPermissions() : array<string|int, mixed>
- Function to get permissions for modules.
- getProfileUtilityPermissions() : array<string|int, mixed>
- Function to get permissions for utility actions.
- getRecordLinks() : array<string|int, Vtiger_Link_Model>
- Get record links.
- getUsersList() : array<string|int, int>
- Function to get Users list from this Profile.
- has() : bool
- Function to check if the key exists.
- hasGlobalReadPermission() : bool
- Check if has global read permission.
- hasGlobalWritePermission() : bool
- Check if has global write permission.
- hasModuleActionPermission() : bool
- Check if has module action permission.
- hasModuleFieldPermission() : bool
- Check if has module field permission.
- hasModuleFieldWritePermission() : bool
- Check if has module field write permission.
- hasModulePermission() : bool
- Check if has module permission.
- isDirectlyRelated() : bool
- Function to check whether the profiles is directly related to role.
- isEmpty() : bool
- Function to check if the key is empty.
- isModuleFieldLocked() : bool
- Check if module field is locked.
- recalculate() : mixed
- Function recalculate the sharing rules.
- remove() : mixed
- Function to remove the value.
- save() : int
- Save record to database.
- set() : $this
- Function to set the value for a given key.
- setData() : $this
- Function to set all the values.
- saveModulePermissions() : mixed
- Save module permissions to database.
- setId() : int
- Function to get the Id.
- tranformInputPermissionValue() : int
- Transform input permission value.
Constants
PROFILE_FIELD_INACTIVE
Profile field inactive.
public
int
PROFILE_FIELD_INACTIVE
= 0
PROFILE_FIELD_READONLY
Profile field readonly.
public
int
PROFILE_FIELD_READONLY
= 1
PROFILE_FIELD_READWRITE
Profile field readwrite.
public
int
PROFILE_FIELD_READWRITE
= 2
Properties
$value
protected
array<string|int, mixed>
$value
Values
$fieldLockedUiTypes
Field locked UI types.
private
static array<string|int, mixed>
$fieldLockedUiTypes
= [70]
Methods
__construct()
Constructor.
public
__construct([array<string|int, mixed> $values = [] ]) : mixed
Parameters
- $values : array<string|int, mixed> = []
Return values
mixed —delete()
Delete record and optionally transfer assigments to other record.
public
delete(Settings_Profiles_Record_Model $transferToRecord) : mixed
Parameters
- $transferToRecord : Settings_Profiles_Record_Model
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
getAll()
Function to get all the profiles.
public
static getAll() : array<string|int, Settings_Profiles_Record_Model>
Return values
array<string|int, Settings_Profiles_Record_Model> —Array of Settings_Profiles_Record_Model instances
getAllByRole()
Function to get all the profiles linked to the given role.
public
static getAllByRole(string $roleId) : array<string|int, Settings_Profiles_Record_Model>
Parameters
- $roleId : string
Return values
array<string|int, Settings_Profiles_Record_Model> —Array of Settings_Profiles_Record_Model instances
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> —getDeleteActionUrl()
Function to get the Delete Action Url for the current profile.
public
getDeleteActionUrl() : string
Return values
string —getDeleteAjaxUrl()
Function to get the Detail Action Url for the Profile.
public
getDeleteAjaxUrl() : string
Return values
string —getDescription()
Function to get the description of the Profile.
public
getDescription() : string
Return values
string —getDetailViewUrl()
Function to get the Detail Url for the current group.
public
getDetailViewUrl() : string
Return values
string —getDisplayValue()
Get display value.
public
getDisplayValue(string $key) : mixed
Parameters
- $key : string
Return values
mixed —getDuplicateViewUrl()
Function to get the Edit View Url for the Profile.
public
getDuplicateViewUrl() : string
Return values
string —getEditViewUrl()
Function to get the Edit View Url for the Profile.
public
getEditViewUrl() : 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
getGlobalPermissions()
Return global permissions.
public
getGlobalPermissions() : array<string|int, mixed>
Return values
array<string|int, mixed> —getId()
Function to get the Id.
public
getId() : int
Return values
int —Profile Id
getInstanceById()
Function to get the instance of Profile model, given profile id.
public
static getInstanceById(int $profileId) : Settings_Profiles_Record_Model
Parameters
- $profileId : int
Return values
Settings_Profiles_Record_Model —instance, if exists. Null otherwise
getInstanceByName()
Create instance by profile name.
public
static getInstanceByName(string $profileName[, bool $checkOnlyDirectlyRelated = false ][, array<string|int, mixed> $excludedRecordId = [] ]) : self
Parameters
- $profileName : string
- $checkOnlyDirectlyRelated : bool = false
- $excludedRecordId : array<string|int, mixed> = []
Return values
self —getKeys()
Function to get keys.
public
getKeys() : array<string|int, string>
Return values
array<string|int, string> —getModuleFieldPermissionValue()
Return module field permission value.
public
getModuleFieldPermissionValue(string $module, Vtiger_Field_Model $field) : int
Parameters
- $module : string
- $field : Vtiger_Field_Model
Return values
int —getModulePermissions()
Return module permissions.
public
getModulePermissions() : array<string|int, mixed>
Return values
array<string|int, mixed> —getName()
Function to get the Profile Name.
public
getName() : string
Return values
string —getProfileActionPermissions()
Function to get permission for actions.
public
getProfileActionPermissions() : array<string|int, mixed>
Return values
array<string|int, mixed> —getProfileTabFieldModel()
Return profile tab field model.
public
getProfileTabFieldModel(string $module, Vtiger_Field_Model $field) : bool|Vtiger_Field_Model
Parameters
- $module : string
- $field : Vtiger_Field_Model
Return values
bool|Vtiger_Field_Model —getProfileTabFieldPermissions()
Return profile tab field permissions.
public
getProfileTabFieldPermissions(int $tabId) : array<string|int, mixed>
Parameters
- $tabId : int
Return values
array<string|int, mixed> —getProfileTabModel()
Return profile tab model.
public
getProfileTabModel(Vtiger_Module_Model $module) : bool|Vtiger_Module_Model
Parameters
- $module : Vtiger_Module_Model
Return values
bool|Vtiger_Module_Model —getProfileTabPermissions()
Function to get permissions for modules.
public
getProfileTabPermissions() : array<string|int, mixed>
Return values
array<string|int, mixed> —getProfileUtilityPermissions()
Function to get permissions for utility actions.
public
getProfileUtilityPermissions() : array<string|int, mixed>
Return values
array<string|int, mixed> —getRecordLinks()
Get record links.
public
getRecordLinks() : array<string|int, Vtiger_Link_Model>
Return values
array<string|int, Vtiger_Link_Model> —getUsersList()
Function to get Users list from this Profile.
public
static getUsersList([int $profileId = false ]) : array<string|int, int>
Parameters
- $profileId : int = false
Return values
array<string|int, int> —list of user ids
has()
Function to check if the key exists.
public
has(string $key) : bool
Parameters
- $key : string
Return values
bool —hasGlobalReadPermission()
Check if has global read permission.
public
hasGlobalReadPermission() : bool
Return values
bool —hasGlobalWritePermission()
Check if has global write permission.
public
hasGlobalWritePermission() : bool
Return values
bool —hasModuleActionPermission()
Check if has module action permission.
public
hasModuleActionPermission(string $module, Vtiger_Action_Model $action) : bool
Parameters
- $module : string
- $action : Vtiger_Action_Model
Return values
bool —hasModuleFieldPermission()
Check if has module field permission.
public
hasModuleFieldPermission(string $module, Vtiger_Field_Model $field) : bool
Parameters
- $module : string
- $field : Vtiger_Field_Model
Return values
bool —hasModuleFieldWritePermission()
Check if has module field write permission.
public
hasModuleFieldWritePermission(string $module, int $field) : bool
Parameters
- $module : string
- $field : int
Return values
bool —hasModulePermission()
Check if has module permission.
public
hasModulePermission(string $module) : bool
Parameters
- $module : string
Return values
bool —isDirectlyRelated()
Function to check whether the profiles is directly related to role.
public
isDirectlyRelated() : bool
Return values
bool —isEmpty()
Function to check if the key is empty.
public
isEmpty(string $key) : bool
Parameters
- $key : string
Return values
bool —isModuleFieldLocked()
Check if module field is locked.
public
isModuleFieldLocked(string $module, int $field) : bool
Parameters
- $module : string
- $field : int
Return values
bool —recalculate()
Function recalculate the sharing rules.
public
recalculate() : mixed
Return values
mixed —remove()
Function to remove the value.
public
remove(string $key) : mixed
Parameters
- $key : string
Return values
mixed —save()
Save record to database.
public
save() : int
Return values
int —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 —saveModulePermissions()
Save module permissions to database.
protected
saveModulePermissions(Vtiger_Module_Model $moduleModel, array<string|int, mixed> $permissions) : mixed
Parameters
- $moduleModel : Vtiger_Module_Model
- $permissions : array<string|int, mixed>
Return values
mixed —setId()
Function to get the Id.
protected
setId(mixed $id) : int
Parameters
- $id : mixed
Return values
int —Profile Id
tranformInputPermissionValue()
Transform input permission value.
protected
tranformInputPermissionValue(string $value) : int
Parameters
- $value : string