Zed. The source code to build a world.

PersoSelector
in package

Table of Contents

Properties

$db  : DatabaseEngine
$hasPerso  : bool
$perso  : Perso
$smarty  : Smarty
$user  : User

Methods

__construct()  : mixed
load()  : Perso
Run all the workflow to get a perso.
selectAndSetPerso()  : void
Select a perso, as a fresh login.
setPerso()  : void
getDefaultEvents()  : array<string|int, BaseEvent>
Select a perso using several strategies in a sequential order.
handleEvents()  : void

Properties

Methods

__construct()

public __construct(DatabaseEngine $db, User $user, Smarty $smarty) : mixed
Parameters
$db : DatabaseEngine
$user : User

The currently logged user

$smarty : Smarty

load()

Run all the workflow to get a perso.

public static load(DatabaseEngine $db, User $user, Smarty $smarty) : Perso
Parameters
$db : DatabaseEngine
$user : User
$smarty : Smarty
Return values
Perso

selectAndSetPerso()

Select a perso, as a fresh login.

public selectAndSetPerso(Perso $perso) : void

If the perso is already logged in, we can call PersoSelector::setPerso instead.

Parameters
$perso : Perso

getDefaultEvents()

Select a perso using several strategies in a sequential order.

private getDefaultEvents() : array<string|int, BaseEvent>

Order matters: for example, to be able to log a perso out, we first need to select it from the session.

Return values
array<string|int, BaseEvent>

        
On this page

Search results