Application
extends Entity
in package
Application class
This class maps the Application table.
This class also provides methods application API helper methods, to generate an application user key or to gets the perso ID from such a key.
Table of Contents
Properties
- $api_key : mixed
- $code : mixed
- $description : mixed
- $id : mixed
- $lastError : string
- $name : mixed
- $db : DatabaseEngine
Methods
- __construct() : mixed
- Initializes a new instance
- from_api_key() : Application
- Loads an Application object from its API key
- generate_userkey() : string
- Generates a key for the specified perso and current application.
- get_perso_id() : int
- Gets the perso ID from an application user key
- getDatabase() : DatabaseEngine
- load_from_database() : bool
- Loads the object Application (ie fill the properties) from the database
- load_from_form() : mixed
- Loads the object Application (ie fill the properties) from the $_POST array
- save_to_database() : void
- Saves to database
- setDatabase() : void
Properties
$api_key
public
mixed
$api_key
$code
public
mixed
$code
$description
public
mixed
$description
$id
public
mixed
$id
$lastError
public
string
$lastError
= ""
$name
public
mixed
$name
$db
private
DatabaseEngine
$db
Methods
__construct()
Initializes a new instance
public
__construct(DatabaseEngine $db[, mixed $id = null ]) : mixed
Parameters
- $db : DatabaseEngine
- $id : mixed = null
from_api_key()
Loads an Application object from its API key
public
static from_api_key(DatabaseEngine $db, string $key) : Application
Parameters
- $db : DatabaseEngine
- $key : string
Return values
Application —the application matching the API key
generate_userkey()
Generates a key for the specified perso and current application.
public
generate_userkey(Perso $perso[, string|null $userKey = null ]) : string
Parameters
- $perso : Perso
- $userKey : string|null = null
Return values
stringget_perso_id()
Gets the perso ID from an application user key
public
get_perso_id(string $userkey) : int
Parameters
- $userkey : string
-
User application key GUID
Return values
int —the perso ID
getDatabase()
public
getDatabase() : DatabaseEngine
Return values
DatabaseEngineload_from_database()
Loads the object Application (ie fill the properties) from the database
public
load_from_database() : bool
Return values
boolload_from_form()
Loads the object Application (ie fill the properties) from the $_POST array
public
load_from_form() : mixed
save_to_database()
Saves to database
public
save_to_database() : void
setDatabase()
public
setDatabase(DatabaseEngine $db) : void
Parameters
- $db : DatabaseEngine