Stud.IP  2.0 Revision 48548
 All Data Structures Namespaces Files Functions Variables Pages
DBManager Class Reference
Collaboration diagram for DBManager:
Collaboration graph

Public Member Functions

 getConnection ($database)
 setConnection ($database, $dsn, $user, $pass)
 aliasConnection ($new, $old)
 getInstance ()
 getConnection ($database)
 setConnection ($database, $dsn, $user, $pass)
 aliasConnection ($new, $old)

Static Public Member Functions

static getInstance ()
static get ($database= 'studip')
static get ($database= 'studip')

Member Function Documentation

aliasConnection (   $new,
  $old 
)

This method creates an alias for a database connection.

Parameters
stringthe new key of the database connection
stringthe old key of the database connection
Returns
DBManager this instance, useful for cascading method calls
aliasConnection (   $new,
  $old 
)

This method creates an alias for a database connection.

Parameters
stringthe new key of the database connection
stringthe old key of the database connection
Returns
DBManager this instance, useful for cascading method calls
static get (   $database = 'studip')
static

Shortcut static method to retrieve the database connection for a given key.

Parameters
stringthe database connection's key
Returns
PDO the database connection

Here is the call graph for this function:

static get (   $database = 'studip')
static

Shortcut static method to retrieve the database connection for a given key.

Parameters
stringthe database connection's key
Returns
PDO the database connection

Here is the call graph for this function:

getConnection (   $database)

This method returns the database connection to the given key. Throws a DBManagerException if there is no such connection.

Parameters
stringthe database connection's key
Exceptions
DBManagerException
Returns
PDO the database connection
getConnection (   $database)

This method returns the database connection to the given key. Throws a DBManagerException if there is no such connection.

Parameters
stringthe database connection's key
Exceptions
DBManagerException
Returns
PDO the database connection
static getInstance ( )
static

This method returns the singleton instance of this class.

Returns
DBManager the singleton instance

Here is the caller graph for this function:

getInstance ( )

This method returns the singleton instance of this class.

Returns
DBManager the singleton instance
setConnection (   $database,
  $dsn,
  $user,
  $pass 
)

This method creates a database connection and stores it under the given key.

Parameters
stringthe key of the database connection
stringthe connection's DSN
stringthe connection's username
stringthe connection's password
Returns
DBManager this instance, useful for cascading method calls
setConnection (   $database,
  $dsn,
  $user,
  $pass 
)

This method creates a database connection and stores it under the given key.

Parameters
stringthe key of the database connection
stringthe connection's DSN
stringthe connection's username
stringthe connection's password
Returns
DBManager this instance, useful for cascading method calls

The documentation for this class was generated from the following files: