Ryzom Account Management System  1.0
Public Member Functions | Private Attributes
DBLayer Class Reference

Handles the database connections. More...

Public Member Functions

 __construct ($db)
 The constructor.
 executeWithoutParams ($query)
 execute a query that doesn't have any parameters
 execute ($query, $params)
 execute a query that has parameters
 executeReturnId ($query, $params)
 execute a query (an insertion query) that has parameters and return the id of it's insertion

Private Attributes

 $PDO
 The PDO object, instantiated by the constructor.

Detailed Description

Handles the database connections.

It uses PDO to connect to the different databases. It will use the argument of the constructor to setup a connection to the database with the matching entry in the $cfg global variable.

Author:
Daan Janssens, mentored by Matthew Lagoe

Constructor & Destructor Documentation

__construct ( db)

The constructor.

Instantiates the PDO object attribute by connecting to the arguments matching database(the db info is stored in the $cfg global var)

Parameters:
$dbString, the name of the databases entry in the $cfg global var.

Member Function Documentation

execute ( query,
params 
)

execute a query that has parameters

Parameters:
$querythe mysql query
$paramsthe parameters that are being used by the query
Returns:
returns a PDOStatement object
executeReturnId ( query,
params 
)

execute a query (an insertion query) that has parameters and return the id of it's insertion

Parameters:
$querythe mysql query
$paramsthe parameters that are being used by the query
Returns:
returns the id of the last inserted element.
executeWithoutParams ( query)

execute a query that doesn't have any parameters

Parameters:
$querythe mysql query
Returns:
returns a PDOStatement object

Field Documentation

$PDO [private]

The PDO object, instantiated by the constructor.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables