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

Public Member Functions

 __construct (IConfig $config)
 isConnected ()
 getConnection ()
 disconnect ()
 getFeatureLevel ($feature)
- Public Member Functions inherited from IConnection
 connect ()

Data Fields


Protected Attributes

 $features = array()

Detailed Description

A database connection class. This class is a wrapper around PHP's PDO database connection object.

Constructor & Destructor Documentation

__construct ( IConfig  $config)
Constructor for the database connection object instantiates the object but does not connect it to a database
@param IConfig $config database connection configuration object
@throw ConfigException when DSN specified with $config object has invalid format
@throw \lib360\db\object\NotFoundException when driver specified with $config cannot be loaded
extra logging when throws exception?

TODO implement some logging here

Implements IConnection.

Member Function Documentation

disconnect ( )

Closes the connection

Implements IConnection.

getConnection ( )

Retrieves the underlying connection object

connection object if connected, NULL otherwise
getFeatureLevel (   $feature)

Get feature support level

mixed feature support level

Implements IConnection.

isConnected ( )

Checks whether the database connection is active

boolean TRUE if connected, boolean FALSE otherwise TODO is there a better way to check if connection is live?

Implements IConnection.

Field Documentation


Connection configuration object. Internal property used to store database connection configuration object.


Connection object. Internal property used to store the PHP PDO connection object.


Driver object. Used to retrieve connection specific behavior.

$features = array()

Features array Used to specify support for specific features. Extending classes should specify what features and levels they support.

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