Session
extends AuthenticationObject
in package
Uses
HandleTrait, RetrievalTrait
Table of Contents
- $dbExpression : array<string|int, mixed>
- $dbTable : string
- $data : array<string|int, mixed>|null
- $id : int|null
- $shouldRefresh : bool
- __construct() : mixed
- add() : Session
- all() : array<string|int, object>
- Get a list of permission objects (user or role)
- byId() : object|null
- Get a permission object (user or role) by its id
- byIds() : array<string|int, object>
- Get a list of permission objects (user or role) by their ids
- byToken() : Session|null
- byUser() : array<string|int, mixed>
- checkInstance() : mixed
- clearFields() : void
- created() : string|null
- expiresAt() : string|null
- extend() : void
- extendedSeconds() : int|null
- getAll() : array<string|int, mixed>
- getField() : mixed
- id() : mixed
- invalidate() : void
- isExpired() : bool
- loadObject() : mixed
- nullId() : mixed
- refresh() : void
- Refresh the current permission object (user or role) by clearing all its fields and setting them new
- setExtensionTime() : void
- token() : string|null
- userId() : int|null
- userIdExec() : int|null
- setField() : void
- refreshOnNextUse() : void
Properties
$dbExpression
public
static array<string|int, mixed>
$dbExpression
= []
$dbTable
public
static string
$dbTable
= "z_logintoken"
$data
protected
array<string|int, mixed>|null
$data
= null
The data of the authentication object
$id
private
int|null
$id
= null
The ID of the authentication object
$shouldRefresh
private
bool
$shouldRefresh
= false
Methods
__construct()
public
__construct(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
Return values
mixed —add()
public
static add(User $user[, User|null $userExec = null ]) : Session
Parameters
Return values
Session —all()
Get a list of permission objects (user or role)
public
static all() : array<string|int, object>
Return values
array<string|int, object> —byId()
Get a permission object (user or role) by its id
public
static byId(int|string $id) : object|null
Parameters
- $id : int|string
-
the id of the object
Return values
object|null —the permission object if found, null otherwise
byIds()
Get a list of permission objects (user or role) by their ids
public
static byIds(int ...$ids) : array<string|int, object>
Parameters
- $ids : int
-
The ids of the objects to retrieve
Return values
array<string|int, object> —The list of permission objects
byToken()
public
static byToken(string $token) : Session|null
Parameters
- $token : string
Return values
Session|null —byUser()
public
static byUser(User $user) : array<string|int, mixed>
Parameters
- $user : User
Return values
array<string|int, mixed> —checkInstance()
public
checkInstance() : mixed
Return values
mixed —clearFields()
public
clearFields() : void
Return values
void —created()
public
created() : string|null
Return values
string|null —expiresAt()
public
expiresAt([bool $refresh = true ]) : string|null
Parameters
- $refresh : bool = true
Return values
string|null —extend()
public
extend(int $seconds) : void
Parameters
- $seconds : int
Return values
void —extendedSeconds()
public
extendedSeconds() : int|null
Return values
int|null —getAll()
public
getAll() : array<string|int, mixed>
Return values
array<string|int, mixed> —getField()
public
getField(string $field) : mixed
Parameters
- $field : string
Return values
mixed —id()
public
id() : mixed
Return values
mixed —invalidate()
public
invalidate() : void
Return values
void —isExpired()
public
isExpired() : bool
Return values
bool —loadObject()
public
loadObject(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
Return values
mixed —nullId()
public
nullId() : mixed
Return values
mixed —refresh()
Refresh the current permission object (user or role) by clearing all its fields and setting them new
public
refresh() : void
Tags
Return values
void —setExtensionTime()
public
setExtensionTime(int $seconds) : void
Parameters
- $seconds : int
Return values
void —token()
public
token() : string|null
Return values
string|null —userId()
public
userId() : int|null
Return values
int|null —userIdExec()
public
userIdExec() : int|null
Return values
int|null —setField()
protected
setField(string $field, mixed $value) : void
Parameters
- $field : string
- $value : mixed
Return values
void —refreshOnNextUse()
private
refreshOnNextUse() : void