Properties

$sql

$sql : \rex_sql

SQL instance.

Type

\rex_sql —

$roleClass

$roleClass

Class name for user roles.

Methods

clearInstance()

clearInstance(mixed  $key) : mixed

Removes the instance of the given key.

Parameters

mixed $key

Key

Returns

mixed —

clearInstancePool()

clearInstancePool() : mixed

Clears the instance pool.

Returns

mixed —

__construct()

__construct(\rex_sql  $sql) : mixed

Constructor.

Parameters

\rex_sql $sql

Returns

mixed —

get()

get(int  $id) : ?self

Parameters

int $id

Returns

?self —

forLogin()

forLogin(string  $login) : ?self

Parameters

string $login

Returns

?self —

require()

require(int  $id) : self

Parameters

int $id

Returns

self —

fromSql()

fromSql(\rex_sql  $sql) : self

Parameters

\rex_sql $sql

Returns

self —

getValue()

getValue(string  $key) : string

Returns the value for the given key.

Parameters

string $key

Key

Returns

string —

value

getId()

getId() : int

Returns the ID.

Returns

int —

getLogin()

getLogin() : string

Returns the user login.

Returns

string —

Login

getName()

getName() : string

Returns the name.

Returns

string —

Name

getEmail()

getEmail() : string

Returns the email.

Returns

string —

email

isAdmin()

isAdmin() : bool

Returns if the user is an admin.

Returns

bool —

getLanguage()

getLanguage() : string

Returns the language.

Returns

string —

Language

getStartPage()

getStartPage() : string

Returns the start page.

Returns

string —

Start page

hasRole()

hasRole() : bool

Returns if the user has a role.

Returns

bool —

hasPerm()

hasPerm(string  $perm) : bool

Returns if the user has the given permission.

Parameters

string $perm

Perm key

Returns

bool —

getComplexPerm()

getComplexPerm(string  $key) : \rex_complex_perm|null

Returns the complex perm for the user.

Parameters

string $key

Complex perm key

Returns

\rex_complex_perm|null —

Complex perm

setRoleClass()

setRoleClass(class-string<\rex_user_role_interface>  $class) : mixed

Sets the role class.

Parameters

class-string<\rex_user_role_interface> $class

Class name

Returns

mixed —

addInstance()

addInstance(mixed  $key, self  $instance) : mixed

Adds an instance.

Parameters

mixed $key

Key

self $instance

Instance

Returns

mixed —

hasInstance()

hasInstance(mixed  $key) : bool

Checks whether an instance exists for the given key.

Parameters

mixed $key

Key

Returns

bool —

getInstance()

getInstance(mixed  $key, callable  $createCallback = null) : null|static

Returns the instance for the given key.

If the instance does not exist it will be created by calling the $createCallback

Parameters

mixed $key

Key

callable $createCallback

Callback, will be called to create a new instance

Returns

null|static —