Combu Server  3.1.1
PHP API Documentation
Public Member Functions | Static Public Member Functions | Data Fields
SessionToken Class Reference
Inheritance diagram for SessionToken:
DataClass

Public Member Functions

 __construct ($src=null, $stripSlashes=false)
 
 Save ()
 
 UpdateLastAction ()
 
 Delete ()
 
- Public Member Functions inherited from DataClass
 Save ()
 
 Delete ()
 
 ToJson ()
 
 ToArray ()
 

Static Public Member Functions

static Load ($idAccount=0, $fromDate=NULL, $toDate=NULL, $idApp=0, $ipAddress=NULL, $limit=NULL, $offset=NULL, &$count=NULL)
 
static ClearSessions ($idAccount, $deleteAll=FALSE)
 
static GetLastSession ($idAccount)
 
static SetSession ($idAccount, $token)
 
static UnsetSession ($idAccount, $token)
 
static Prune ()
 
- Static Public Member Functions inherited from DataClass
static GetTableName ($class)
 
static LoadRecords ($query, $returnedClass="")
 
static CountRecords ($tableName, $filter=null)
 
static TruncateTable ($tableName)
 
static TruncateClass ($class)
 

Data Fields

const TABLE_NAME = "SessionToken"
 
 $Token = ""
 
 $IdApp = 0
 
 $IPAddress = ""
 
 $Created = ""
 
 $RSA_PrivateKey = ""
 
 $RSA_PublicKey = ""
 
 $AES_Key = ""
 
 $AES_IV = ""
 
 $IdAccount = 0
 
 $ClientVersion = ""
 
 $Updated = ""
 

Additional Inherited Members

- Protected Member Functions inherited from DataClass
 _loadFilter ($tableName, $filter)
 
 _loadByRow ($row, $stripSlashes=false, $callbackOnExists=false)
 
 _Delete ($tableName, $filter=null)
 
- Static Protected Member Functions inherited from DataClass
static _count ($tableName, $filter=null)
 
static _load ($tableName, $returnedClass="", $where="", $order=null, $limit=null, $offset=null, &$count=null)
 
static _loadEx ($select, $from, $returnedClass="", $where="", $order=null, $limit=null, $offset=null, &$count=null, $debug=false)
 
static _loadQuery ($query, $returnedClass="")
 

Detailed Description

Class to handle session tokens

Author
Skared Creations

Definition at line 10 of file SessionToken.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $src = null,
  $stripSlashes = false 
)

Contructor

Definition at line 29 of file SessionToken.php.

Member Function Documentation

◆ ClearSessions()

static ClearSessions (   $idAccount,
  $deleteAll = FALSE 
)
static

Delete older sessions of this player

Parameters
int$idAccountIdAccount Database $Database

Definition at line 134 of file SessionToken.php.

◆ Delete()

Delete ( )

Delete the record from the database Database $Database

Returns
bool Returns TRUE on success

Definition at line 219 of file SessionToken.php.

◆ GetLastSession()

static GetLastSession (   $idAccount)
static

Get the last session of an account

$AppId Current AppId as web service

Parameters
int$idAccountAccount Id
Returns
Returns the last session or NULL

Definition at line 159 of file SessionToken.php.

◆ Load()

static Load (   $idAccount = 0,
  $fromDate = NULL,
  $toDate = NULL,
  $idApp = 0,
  $ipAddress = NULL,
  $limit = NULL,
  $offset = NULL,
$count = NULL 
)
static

Get the registered news

Database $Database

Parameters
int$idAccountFilter IdAccount
string$fromDateFilter Created (range start)
string$toDateFilter Created (range end)
int$idAppFilter IdApp
string$ipAddressFilter IPAddress
int$limitMax number of results (for paged results)
int$offsetOffset number of results (for paged results)
int$countWill be set to the total count of results
Returns
array Returns the array of records

Definition at line 57 of file SessionToken.php.

◆ Prune()

static Prune ( )
static

Delete all records associated to this class

Definition at line 230 of file SessionToken.php.

◆ Save()

Save ( )

Save the record in the database

Database $Database

Returns
bool Returns TRUE on success

Definition at line 84 of file SessionToken.php.

◆ SetSession()

static SetSession (   $idAccount,
  $token 
)
static

Set an account to a session

$Database

Parameters
int$idAccountAccount Id
string$tokenToken
Returns
boolean Returns TRUE on success

Definition at line 180 of file SessionToken.php.

◆ UnsetSession()

static UnsetSession (   $idAccount,
  $token 
)
static

Delete a session of an account

$Database

Parameters
int$idAccountAccount Id
string$tokenToken
Returns
boolean Returns TRUE on success

Definition at line 201 of file SessionToken.php.

◆ UpdateLastAction()

UpdateLastAction ( )

Updates the last action datetime

Database $Database

Returns
boolean Returns TRUE on success

Definition at line 116 of file SessionToken.php.

Field Documentation

◆ $AES_IV

$AES_IV = ""

Definition at line 21 of file SessionToken.php.

◆ $AES_Key

$AES_Key = ""

Definition at line 20 of file SessionToken.php.

◆ $ClientVersion

$ClientVersion = ""

Definition at line 23 of file SessionToken.php.

◆ $Created

$Created = ""

Definition at line 17 of file SessionToken.php.

◆ $IdAccount

$IdAccount = 0

Definition at line 22 of file SessionToken.php.

◆ $IdApp

$IdApp = 0

Definition at line 15 of file SessionToken.php.

◆ $IPAddress

$IPAddress = ""

Definition at line 16 of file SessionToken.php.

◆ $RSA_PrivateKey

$RSA_PrivateKey = ""

Definition at line 18 of file SessionToken.php.

◆ $RSA_PublicKey

$RSA_PublicKey = ""

Definition at line 19 of file SessionToken.php.

◆ $Token

$Token = ""

Definition at line 14 of file SessionToken.php.

◆ $Updated

$Updated = ""

Definition at line 24 of file SessionToken.php.

◆ TABLE_NAME

const TABLE_NAME = "SessionToken"

Definition at line 12 of file SessionToken.php.