spoof
 All Data Structures Namespaces Files Functions Variables Pages
Pool Class Reference
Inheritance diagram for Pool:
Collaboration diagram for Pool:

Static Public Member Functions

static add (IConnection $conn, $name)
static getByName ($name, $connect=TRUE)
static removeByName ($name, $disconnect=TRUE)
static closeAll ()

Static Protected Attributes

static $connections = array()

Detailed Description

Connection pooling implementation. This static class provides connection pooling functionality for database connections.


Member Function Documentation

static add ( IConnection  $conn,
  $name 
)
static

Adds the specified connection to the connection pool and assigns the specified alias.

Parameters:
IConnection$conndatabase connection object
string$namename alias for the connection
Exceptions:
InvalidArgumentExceptionwhen supplied alias already exists

Implements IPool.

static closeAll ( )
static

Closes all active connections in the pool.

Implements IPool.

static getByName (   $name,
  $connect = TRUE 
)
static

Retrieves previously stored database connection object by its alias.

Parameters:
string$nameconnection name
boolean$connectif TRUE and not yet connected the database connection will be attempted, default TRUE
Returns:
Connection object
Exceptions:
InvalidArgumentExceptionwhen supplied alias is not found in the pool

Implements IPool.

Here is the caller graph for this function:

static removeByName (   $name,
  $disconnect = TRUE 
)
static

Removes connection from pool

Parameters:
string$nameconnection name
boolean$disconnectwhether to disconnect (if connected) first, default TRUE
Exceptions:
\InvalidArgumentExceptionwhen supplied alias is not found in the pool

Here is the call graph for this function:


Field Documentation

$connections = array()
staticprotected

A connections array. Stores connection objects for internal use.


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