Class Database_Common

Description

Common Database Abstraction Layer

Parent class that our database driver classes should be extending. Contains basic functionality for instantiation and interfacing.

  • abstract:

Located in /classes/Database/Common.php (line 24)

Object
   |
   --Database_Common
Direct descendents
Class Description
Database_Mongo Mongo Database Abstraction Layer
Database_PDO_Common PDO Abstraction Layer
Variable Summary
object $connection
string $database
string $driver
string $hostname
string $password
integer $port
object $results
integer $socket
string $username
Method Summary
Database_Common __construct ()
boolean close ()
boolean open ()
void setDatabase (string $database)
void setHostname (string $hostname)
void setPassword (string $password)
void setPort (integer $port)
void setSocket (string $socket)
void setUsername (string $username)
Variables
object $connection = null (line 88)

Connection resource

  • access: protected
string $database = null (line 80)

Database name for the server

  • access: protected
string $driver (line 32)

Driver

  • access: protected

Redefined in descendants as:
string $hostname = 'localhost' (line 40)

Hostname for the server

  • access: protected
string $password = null (line 72)

Password for the server

  • access: protected
integer $port = null (line 48)

Port number for the server

  • access: protected

Redefined in descendants as:
object $results = null (line 96)

Results object for the executed statement

  • access: protected
integer $socket = null (line 56)

UNIX socket for the server

  • access: protected
string $username = null (line 64)

Username for the server

  • access: protected

Inherited Variables

Inherited from Object

Object::$config
Object::$instances
Methods
Constructor __construct (line 101)

Constructor

  • access: public
Database_Common __construct ()

Redefinition of:
Object::__construct()
Constructor

Redefined in descendants as:
close (line 197)

Closes database connection

Sets the connection to null regardless of state.

  • return: always true
  • abstract:
  • access: public
boolean close ()

Redefined in descendants as:
open (line 188)

Opens database connection

Establishes a connection to the MySQL database based on the configuration options that are available in the Config object.

  • return: true on success, throws an exception overwise
  • abstract:
  • access: public
boolean open ()

Redefined in descendants as:
setDatabase (line 174)

Set Database

  • access: public
void setDatabase (string $database)
  • string $database: database for the database
setHostname (line 124)

Set Hostname

  • access: public
void setHostname (string $hostname)
  • string $hostname: hostname for the database
setPassword (line 164)

Set Password

  • access: public
void setPassword (string $password)
  • string $password: password for the database
setPort (line 134)

Set Port

  • access: public
void setPort (integer $port)
  • integer $port: port for the database
setSocket (line 144)

Set Socket

  • access: public
void setSocket (string $socket)
  • string $socket: name of the UNIX socket
setUsername (line 154)

Set Username

  • access: public
void setUsername (string $username)
  • string $username: username for the database

Inherited Methods

Inherited From Object

Object::__construct()
Object::getInstance()
Object::__destruct()

Documentation generated on Sun, 17 Oct 2010 23:17:22 -0400 by phpDocumentor 1.4.3