UserProvider
in package
implements
UserProviderInterface
UserProvider is responsible for providing the user with the correct user hash and session id
Table of Contents
Interfaces
Properties
- $newSessionParams : SessionParams
- $storage : StorageFacadeInterface
- $user : User
- $userHash : string
- $userId : string
Methods
- __construct() : mixed
- ensureSession() : void
- Ensure the session
- getStorage() : StorageFacadeInterface
- Get the storage driver instance
- getUser() : User
- Get the user
- getUserHash() : string
- Get the user hash
- isSessionStarted() : bool
- Check if the session is started
- startSession() : void
- Start the session
- generateSessionId() : string
- Generate the session id
- generateUserHash() : string
- Generate the user hash
- mergeSessionParams() : void
- Merge the session params
Properties
$newSessionParams
private
SessionParams
$newSessionParams
$storage
private
StorageFacadeInterface
$storage
$user
private
User
$user
$userHash
private
string
$userHash
$userId
private
string
$userId
Methods
__construct()
public
__construct(StorageFacadeInterface $storage, string $userId[, SessionParams $newSessionParams = null ]) : mixed
Parameters
- $storage : StorageFacadeInterface
- $userId : string
- $newSessionParams : SessionParams = null
ensureSession()
Ensure the session
public
ensureSession([int $sessionTimeout = 36000 ]) : void
Parameters
- $sessionTimeout : int = 36000
getStorage()
Get the storage driver instance
public
getStorage() : StorageFacadeInterface
Return values
StorageFacadeInterfacegetUser()
Get the user
public
getUser() : User
Return values
UsergetUserHash()
Get the user hash
public
getUserHash() : string
Return values
stringisSessionStarted()
Check if the session is started
public
isSessionStarted() : bool
Return values
boolstartSession()
Start the session
public
startSession([int $sessionTimeout = 36000 ]) : void
Parameters
- $sessionTimeout : int = 36000
generateSessionId()
Generate the session id
private
generateSessionId() : string
Return values
stringgenerateUserHash()
Generate the user hash
private
generateUserHash(string $userId) : string
Parameters
- $userId : string
Return values
stringmergeSessionParams()
Merge the session params
private
mergeSessionParams() : void