User
in package
User basic class.
Tags
Table of Contents
- $currentUserCache : mixed
- $currentUserId : mixed
- $currentUserRealId : mixed
- $privileges : mixed
- $userModelCache : mixed
- $userPrivilegesCache : mixed
- $userSharingCache : mixed
- checkPreviousPassword() : bool
- Check the previous password.
- clearCache() : mixed
- Clear user cache.
- get() : mixed
- Get user parameters.
- getActiveAdminId() : int
- Function to get the user if of the active admin user.
- getAllLabels() : bool|array<string|int, mixed>
- The function gets the all users label.
- getCurrentUserId() : int
- Get current user Id.
- getCurrentUserModel() : self
- Get current user model.
- getCurrentUserRealId() : int
- Get real current user Id.
- getDetail() : mixed
- Get user detail.
- getDetails() : mixed
- Get user all details.
- getGroupNames() : array<string|int, string>
- Get user group names.
- getGroups() : array<string|int, mixed>
- Get user groups.
- getId() : int|null
- Get user id.
- getImage() : array<string|int, mixed>|array<string|int, string>
- Get user image details.
- getImageById() : array<string|int, mixed>|array<string|int, string>
- Get user image details by id.
- getMemberStructure() : array<string|int, mixed>
- Gets member structure.
- getName() : int
- Get user id.
- getNumberOfUsers() : int
- Get number of users.
- getParentRoles() : array<string|int, mixed>
- Get user parent roles.
- getParentRolesSeq() : string
- Get user parent roles seq.
- getPrivilegesFile() : array<string|int, mixed>
- Get base privileges from file by id.
- getProfiles() : array<string|int, mixed>
- Get user profiles.
- getRole() : string
- Get user role Id.
- getRoleInstance() : Settings_Roles_Record_Model
- Get user role instance.
- getRoleName() : string
- Get user role Id.
- getSharingFile() : array<string|int, mixed>
- Get sharing privileges from file by id.
- getUserIdByFullName() : int
- Function gets user ID by user full name.
- getUserIdByName() : int
- Function gets user ID by name.
- getUserModel() : self
- Get user model by id.
- has() : bool
- Check for existence of key.
- isActive() : bool
- Function checks if user is active.
- isAdmin() : bool
- Function to check whether the user is an Admin user.
- isExists() : bool
- Function checks if user exists.
- isSuperUser() : bool
- Function to check whether the user is an super user.
- set() : mixed
- Set user parameters.
- setCurrentUserId() : mixed
- Set current user Id.
- updateLabels() : void
- Update users labels.
Properties
$currentUserCache
protected
static mixed
$currentUserCache
= false
$currentUserId
protected
static mixed
$currentUserId
$currentUserRealId
protected
static mixed
$currentUserRealId
= false
$privileges
protected
mixed
$privileges
= []
$userModelCache
protected
static mixed
$userModelCache
= []
$userPrivilegesCache
protected
static mixed
$userPrivilegesCache
= []
$userSharingCache
protected
static mixed
$userSharingCache
= []
Methods
checkPreviousPassword()
Check the previous password.
public
static checkPreviousPassword(int $userId, string $password) : bool
Parameters
- $userId : int
- $password : string
Return values
bool —clearCache()
Clear user cache.
public
static clearCache([bool|int $userId = false ]) : mixed
Parameters
- $userId : bool|int = false
Return values
mixed —get()
Get user parameters.
public
get(string $key) : mixed
Parameters
- $key : string
Return values
mixed —getActiveAdminId()
Function to get the user if of the active admin user.
public
static getActiveAdminId() : int
Return values
int —- Active Admin User ID
getAllLabels()
The function gets the all users label.
public
static getAllLabels() : bool|array<string|int, mixed>
Return values
bool|array<string|int, mixed> —getCurrentUserId()
Get current user Id.
public
static getCurrentUserId() : int
Return values
int —getCurrentUserModel()
Get current user model.
public
static getCurrentUserModel() : self
Return values
self —getCurrentUserRealId()
Get real current user Id.
public
static getCurrentUserRealId() : int
Return values
int —getDetail()
Get user detail.
public
getDetail(string $fieldName) : mixed
Parameters
- $fieldName : string
Return values
mixed —getDetails()
Get user all details.
public
getDetails() : mixed
Return values
mixed —getGroupNames()
Get user group names.
public
getGroupNames() : array<string|int, string>
Return values
array<string|int, string> —getGroups()
Get user groups.
public
getGroups() : array<string|int, mixed>
Return values
array<string|int, mixed> —getId()
Get user id.
public
getId() : int|null
Return values
int|null —getImage()
Get user image details.
public
getImage() : array<string|int, mixed>|array<string|int, string>
Tags
Return values
array<string|int, mixed>|array<string|int, string> —getImageById()
Get user image details by id.
public
static getImageById(int $userId) : array<string|int, mixed>|array<string|int, string>
Parameters
- $userId : int
Tags
Return values
array<string|int, mixed>|array<string|int, string> —getMemberStructure()
Gets member structure.
public
getMemberStructure() : array<string|int, mixed>
Return values
array<string|int, mixed> —getName()
Get user id.
public
getName() : int
Return values
int —getNumberOfUsers()
Get number of users.
public
static getNumberOfUsers() : int
Return values
int —getParentRoles()
Get user parent roles.
public
getParentRoles() : array<string|int, mixed>
Return values
array<string|int, mixed> —getParentRolesSeq()
Get user parent roles seq.
public
getParentRolesSeq() : string
Return values
string —getPrivilegesFile()
Get base privileges from file by id.
public
static getPrivilegesFile(int $userId) : array<string|int, mixed>
Parameters
- $userId : int
Return values
array<string|int, mixed> —getProfiles()
Get user profiles.
public
getProfiles() : array<string|int, mixed>
Return values
array<string|int, mixed> —getRole()
Get user role Id.
public
getRole() : string
Return values
string —getRoleInstance()
Get user role instance.
public
getRoleInstance() : Settings_Roles_Record_Model
Return values
Settings_Roles_Record_Model —getRoleName()
Get user role Id.
public
getRoleName() : string
Return values
string —getSharingFile()
Get sharing privileges from file by id.
public
static getSharingFile(int $userId) : array<string|int, mixed>
Parameters
- $userId : int
Return values
array<string|int, mixed> —getUserIdByFullName()
Function gets user ID by user full name.
public
static getUserIdByFullName(string $fullName) : int
Parameters
- $fullName : string
Return values
int —getUserIdByName()
Function gets user ID by name.
public
static getUserIdByName(string $name) : int
Parameters
- $name : string
Return values
int —getUserModel()
Get user model by id.
public
static & getUserModel(int $userId) : self
Parameters
- $userId : int
Return values
self —has()
Check for existence of key.
public
has(string $key) : bool
Parameters
- $key : string
Return values
bool —isActive()
Function checks if user is active.
public
isActive() : bool
Return values
bool —isAdmin()
Function to check whether the user is an Admin user.
public
isAdmin() : bool
Return values
bool —true/false
isExists()
Function checks if user exists.
public
static isExists(int $id[, bool $active = true ]) : bool
Parameters
- $id : int
-
- User ID
- $active : bool = true
Return values
bool —isSuperUser()
Function to check whether the user is an super user.
public
isSuperUser() : bool
Return values
bool —set()
Set user parameters.
public
set(string $key, mixed $value) : mixed
Parameters
- $key : string
- $value : mixed
Return values
mixed —setCurrentUserId()
Set current user Id.
public
static setCurrentUserId(int $userId) : mixed
Parameters
- $userId : int
Return values
mixed —updateLabels()
Update users labels.
public
static updateLabels(int $fromUserId) : void
Parameters
- $fromUserId : int