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
Variable Summary
boolean $cache
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 ()
string getCache ()
string getDriver ()
boolean open ()
void setCache (boolean $cache)
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
boolean $cache = false (line 88)

Whether or not to use caching

  • access: protected
object $connection = null (line 96)

Connection resource

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

Database name for the server

  • access: protected
string $driver = null (line 32)

Driver

  • access: protected
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
object $results = null (line 104)

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
Methods
Constructor __construct (line 109)

Constructor

  • access: public
Database_Common __construct ()
close (line 240)

Closes database connection

Sets the connection to null regardless of state.

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

Get Cache

Returns the status of caching for this datasource.

  • return: whether or not to use the cache
  • access: public
string getCache ()
getDriver (line 205)

Get Driver

Returns the name of the driver in use. Used by the Model class to determine which path to take when interfacing with the Database object.

  • return: name of the driver in use
  • access: public
string getDriver ()
open (line 231)

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 ()
setCache (line 192)

Set Cache

  • access: public
void setCache (boolean $cache)
  • boolean $cache: whether or not to use cache
setDatabase (line 182)

Set Database

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

Set Hostname

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

Set Password

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

Set Port

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

Set Socket

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

Set Username

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

Documentation generated on Wed, 03 Oct 2012 17:46:05 -0400 by phpDocumentor 1.4.4