\App\CoreModule\ModelsUserManager

Tool for managing users

Summary

Methods
Properties
Constants
__construct()
changePassword()
editPassword()
delete()
edit()
getInfo()
getUsers()
register()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$table
N/A

Properties

$table

$table : \Nette\Database\Table\Selection

Type

\Nette\Database\Table\Selection — Database table selection

Methods

__construct()

__construct(\Nette\Database\Context  $database) : mixed

Constructor

Parameters

\Nette\Database\Context $database

Database context

Returns

mixed

changePassword()

changePassword(int  $id, string  $oldPassword, string  $newPassword) : void

Changes the user's password

Parameters

int $id

User ID

string $oldPassword

Old password

string $newPassword

New password

Throws

\App\CoreModule\Exceptions\InvalidPasswordException

editPassword()

editPassword(int  $id, string  $password) : void

Edits rhe user's password

Parameters

int $id

User ID

string $password

New User's password

delete()

delete(int  $id) : void

Deletes the user

Parameters

int $id

User ID

edit()

edit(int  $id, string|null  $username, string|null  $role, string|null  $language) : void

Edits the user

Parameters

int $id

User ID

string|null $username

New username

string|null $role

New user role

string|null $language

New user's language

Throws

\App\CoreModule\Exceptions\UsernameAlreadyExistsException

getInfo()

getInfo(int  $id) : array|null

Gets information about the user

Parameters

int $id

User ID

Returns

array|null —

Information about the user or null

getUsers()

getUsers() : array

Gets all registered users

Returns

array —

Registered users

register()

register(string  $username, string  $password, string  $role, string  $language) : void

Registers a new user

Parameters

string $username

Username

string $password

Password

string $role

User's role

string $language

User's language

Throws

\App\CoreModule\Exceptions\UsernameAlreadyExistsException