User extends BaseObject
Table of Contents
Constants
- SYSTEM_USER_ID = 0
Properties
Methods
- __construct() : mixed
- canEdit() : bool
- canRead() : bool
- getApplication() : CMain
- getCookieId() : int
- getCurrent() : User
- getErrorByCode() : Error|null
- getErrors() : array<string|int, Error>
- getId() : int
- getUser() : CUser
- getVotedUserId() : int
- init() : void
- exists only for child class
- isUserVotedFor() : bool|int
- isVotedFor() : bool|int
- loadFromId() : BaseObject
- loadUserGroups() : array<string|int, mixed>
- lock() : bool
- onUserLogin() : mixed
- setCookieId() : void
- setVotedUserId() : int
- shutdown() : mixed
- Debug function
- unlock() : mixed
Constants
SYSTEM_USER_ID
public
mixed
SYSTEM_USER_ID
= 0
Properties
$instance
public
static mixed
$instance
= null
$usersIds
public
static mixed
$usersIds
= []
Methods
__construct()
public
__construct(mixed $id) : mixed
Parameters
- $id : mixed
canEdit()
public
canEdit(int $userId) : bool
Parameters
- $userId : int
-
User ID.
Return values
boolcanRead()
public
canRead(int $userId) : bool
Parameters
- $userId : int
-
User ID.
Return values
boolgetApplication()
public
getApplication() : CMain
Return values
CMaingetCookieId()
public
getCookieId() : int
Return values
intgetCurrent()
public
static getCurrent() : User
Return values
UsergetErrorByCode()
public
getErrorByCode(string|int $code) : Error|null
Parameters
- $code : string|int
-
The code of the error.
Tags
Return values
Error|nullgetErrors()
public
getErrors() : array<string|int, Error>
Return values
array<string|int, Error>getId()
public
getId() : int
Return values
intgetUser()
public
getUser() : CUser
Return values
CUsergetVotedUserId()
public
getVotedUserId() : int
Return values
intinit()
exists only for child class
public
init() : void
Tags
isUserVotedFor()
public
static isUserVotedFor(int $voteId, int $userId) : bool|int
Parameters
- $voteId : int
-
Vote ID.
- $userId : int
-
User ID.
Return values
bool|intisVotedFor()
public
isVotedFor(int $voteId) : bool|int
Parameters
- $voteId : int
-
Vote ID.
Return values
bool|intloadFromId()
public
static loadFromId(int $id[, bool $shouldBeNewIfIdIsNull = false ]) : BaseObject
Parameters
- $id : int
-
Entity ID.
- $shouldBeNewIfIdIsNull : bool = false
Return values
BaseObjectloadUserGroups()
public
static loadUserGroups(int $userId) : array<string|int, mixed>
Parameters
- $userId : int
-
User ID.
Return values
array<string|int, mixed>lock()
public
lock(int $voteId) : bool
Parameters
- $voteId : int
Return values
boolonUserLogin()
public
static onUserLogin() : mixed
setCookieId()
public
setCookieId(mixed $id) : void
Parameters
- $id : mixed
setVotedUserId()
public
setVotedUserId([null $incrementCount = null ]) : int
Parameters
- $incrementCount : null = null
-
If true - increment, in false - decrement, null - no changes.
Return values
intshutdown()
Debug function
public
static shutdown() : mixed
unlock()
public
unlock(int $voteId) : mixed
Parameters
- $voteId : int