PHP Class Pantheon\Terminus\Session\Session

Inheritance: implements League\Container\ContainerAwareInterface, implements Robo\Contract\ConfigAwareInterface, implements Pantheon\Terminus\DataStore\DataStoreAwareInterface, use trait Robo\Common\ConfigAwareTrait, use trait League\Container\ContainerAwareTrait, use trait Pantheon\Terminus\DataStore\DataStoreAwareTrait
Show file Open project: pantheon-systems/terminus Class Usage Examples

Public Properties

Property Type Description
$tokens Pantheon\Terminus\Collections\SavedTokens

Protected Properties

Property Type Description
$data object

Public Methods

Method Description
__construct ( Pantheon\Terminus\DataStore\DataStoreInterface $data_store ) Instantiates object, sets session data, instantiates a SavedTokens instance
destroy ( ) Removes the session from the cache
get ( string $key ) : mixed Returns given data property or default if DNE.
getTokens ( ) : SavedTokens
getUser ( ) : User Returns a user with the current session user id
isActive ( ) : boolean Responds with the status of this session (i.e. whether the client is logged in)
setData ( array $data ) Saves session data to cache
setDataStore ( Pantheon\Terminus\DataStore\DataStoreInterface $data_store )

Method Details

__construct() public method

Instantiates object, sets session data, instantiates a SavedTokens instance
public __construct ( Pantheon\Terminus\DataStore\DataStoreInterface $data_store )
$data_store Pantheon\Terminus\DataStore\DataStoreInterface An object to persist the session data.

destroy() public method

Removes the session from the cache
public destroy ( )

get() public method

Returns given data property or default if DNE.
public get ( string $key ) : mixed
$key string Name of property to return
return mixed

getTokens() public method

public getTokens ( ) : SavedTokens
return Pantheon\Terminus\Collections\SavedTokens

getUser() public method

Returns a user with the current session user id
public getUser ( ) : User
return Pantheon\Terminus\Models\User [user] $session user

isActive() public method

Responds with the status of this session (i.e. whether the client is logged in)
public isActive ( ) : boolean
return boolean

setData() public method

Saves session data to cache
public setData ( array $data )
$data array Session data to save

setDataStore() public method

public setDataStore ( Pantheon\Terminus\DataStore\DataStoreInterface $data_store )
$data_store Pantheon\Terminus\DataStore\DataStoreInterface

Property Details

$data protected property

protected object $data
return object

$tokens public property

public SavedTokens,Pantheon\Terminus\Collections $tokens
return Pantheon\Terminus\Collections\SavedTokens