Documentation

User
in package

Manage User connection and data

Table of Contents

connect()  : void
Connect an user to the application
disconnect()  : void
Disconnect user from application and destroy session
get()  : mixed
Get user data
getPermission()  : int
Get all user permissions
havePermission()  : bool
Check if user have a permission
isAuthenticated()  : bool
Check if the user is connected to the application

Methods

connect()

Connect an user to the application

public static connect(User $user) : void
Parameters
$user : User

User model instance

Return values
void

disconnect()

Disconnect user from application and destroy session

public static disconnect() : void
Return values
void

get()

Get user data

public static get([null|string $name = null ]) : mixed
Parameters
$name : null|string = null
Return values
mixed

Return the wanted data or all if null

getPermission()

Get all user permissions

public static getPermission() : int
Return values
int

User permission id

havePermission()

Check if user have a permission

public static havePermission(int $id) : bool
Parameters
$id : int

Permission id

Return values
bool

Check result

isAuthenticated()

Check if the user is connected to the application

public static isAuthenticated() : bool
Return values
bool

Result of the check

Search results