Documentation

rex_user
in package
Uses rex_instance_pool_trait

Class for users.

Tags
author

gharlan

Table of Contents

Properties

$role  : rex_user_role_interface|null
User role instance.
$roleClass  : rex_user_role_interface>
Class name for user roles.
$sql  : rex_sql
SQL instance.

Methods

__construct()  : mixed
clearInstance()  : void
Removes the instance of the given key.
clearInstancePool()  : void
Clears the instance pool.
forLogin()  : self|null
fromSql()  : self
get()  : self|null
getComplexPerm()  : rex_complex_perm|null
Returns the complex perm for the user.
getEmail()  : string
Returns the email.
getId()  : int
Returns the ID.
getLanguage()  : string
Returns the language.
getLogin()  : string
Returns the user login.
getName()  : string
Returns the name.
getStartPage()  : string
Returns the start page.
getValue()  : string
Returns the value for the given key.
hasPerm()  : bool
Returns if the user has the given permission.
hasRole()  : bool
Returns if the user has a role.
isAdmin()  : bool
Returns if the user is an admin.
require()  : self
setRoleClass()  : void
Sets the role class.
addInstance()  : void
Adds an instance.
getInstance()  : static|null
Returns the instance for the given key.
hasInstance()  : bool
Checks whether an instance exists for the given key.

Properties

$roleClass

Class name for user roles.

protected static rex_user_role_interface> $roleClass

$sql

SQL instance.

protected rex_sql $sql

Methods

__construct()

public __construct(rex_sql $sql) : mixed
Parameters
$sql : rex_sql

clearInstance()

Removes the instance of the given key.

public static clearInstance(mixed $key) : void
Parameters
$key : mixed

Key

clearInstancePool()

Clears the instance pool.

public static clearInstancePool() : void

forLogin()

public static forLogin(string $login) : self|null
Parameters
$login : string
Return values
self|null

fromSql()

public static fromSql(rex_sql $sql) : self
Parameters
$sql : rex_sql
Return values
self

get()

public static get(int $id) : self|null
Parameters
$id : int
Return values
self|null

getComplexPerm()

Returns the complex perm for the user.

public getComplexPerm(string $key) : rex_complex_perm|null
Parameters
$key : string

Complex perm key

Tags
psalm-return

rex_complex_perm|null

phpstan-return

rex_media_perm|rex_structure_perm|rex_module_perm|rex_clang_perm|null

Return values
rex_complex_perm|null

Complex perm

getEmail()

Returns the email.

public getEmail() : string
Return values
string

email

getId()

Returns the ID.

public getId() : int
Return values
int

getLanguage()

Returns the language.

public getLanguage() : string
Return values
string

Language

getLogin()

Returns the user login.

public getLogin() : string
Return values
string

Login

getName()

Returns the name.

public getName() : string
Return values
string

Name

getStartPage()

Returns the start page.

public getStartPage() : string
Return values
string

Start page

getValue()

Returns the value for the given key.

public getValue(string $key) : string
Parameters
$key : string

Key

Return values
string

value

hasPerm()

Returns if the user has the given permission.

public hasPerm(string $perm) : bool
Parameters
$perm : string

Perm key

Return values
bool

hasRole()

Returns if the user has a role.

public hasRole() : bool
Return values
bool

isAdmin()

Returns if the user is an admin.

public isAdmin() : bool
Return values
bool

require()

public static require(int $id) : self
Parameters
$id : int
Return values
self

setRoleClass()

Sets the role class.

public static setRoleClass(rex_user_role_interface> $class) : void
Parameters
$class : rex_user_role_interface>

Class name

addInstance()

Adds an instance.

protected static addInstance(mixed $key, self $instance) : void
Parameters
$key : mixed

Key

$instance : self

Instance

getInstance()

Returns the instance for the given key.

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

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

Parameters
$key : mixed

Key

$createCallback : callable = null

Callback, will be called to create a new instance

Tags
psalm-param

callable(mixed...):?static $createCallback

Return values
static|null

hasInstance()

Checks whether an instance exists for the given key.

protected static hasInstance(mixed $key) : bool
Parameters
$key : mixed

Key

Return values
bool

        
On this page

Search results