Interface Database

Description

A Database interface provides generic database functionality: connect(), executeQuery(), etc.

The interface can be implemented for different types of databases: MySQL, Oracle, SQLServer, etc.

  • version: $Id: Database.interface.php,v 1.11 2007/09/05 21:38:59 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright © 2005, Middlebury College

Located in /harmoni/core/DBHandler/Database.interface.php (line 15)


	
			
Method Summary
mixed connect ()
boolean disconnect ()
ref fromDBDate (mixed $value)
string getStringName ()
array getTableList ()
boolean isConnected ()
mixed pConnect ()
mixed query (Query $query)
boolean selectDatabase (string $database)
mixed toDBDate (DateAndTime $dateAndTime)
Methods
beginTransaction (line 134)

Begin a transaction.

  • since: 3/9/05
  • access: public
void beginTransaction ()
commitTransaction (line 144)

Commit a transaction. This will roll-back changes if errors occured in the transaction block.

  • since: 3/9/05
  • access: public
void commitTransaction ()
connect (line 23)

Connects to the database.

Connects to the database.

  • return: The connection's link identifier, if successful; False, otherwise.
  • access: public
mixed connect ()
disconnect (line 54)

Disconnects from the database.

Disconnects from the database.

  • return: True, if successful; False, otherwise.
  • access: public
boolean disconnect ()
fromDBDate (line 116)

Converts a database datetime/timestamp/time value (that has been fetched from the db) to a DateAndTime object.

  • return: object The DateAndTime object.
  • access: public
ref fromDBDate (mixed $value)
  • mixed $value: A database datetime/timestamp/time value (that has been fetched from the db).
getConnectionErrorInfo (line 169)

Answer the info to display to users on a connection error.

  • since: 6/1/06
  • access: public
string getConnectionErrorInfo ()
getNumberFailedQueries (line 87)

Returns the total number of failed queries executed since the last call to connect().

Returns the total number of failed queries executed since the last call to connect().

  • return: The total number of failed queries executed since the last call to connect().
  • access: public
integer getNumberFailedQueries ()
getNumberSuccessfulQueries (line 77)

Returns the total number of successful queries executed since the last call to connect().

Returns the total number of successful queries executed since the last call to connect().

  • return: The total number of successful queries executed since the last call to connect().
  • access: public
integer getNumberSuccessfulQueries ()
getStringName (line 160)

Returns a short string name for this database type. Example: 'MySQL'

  • access: public
string getStringName ()
getTableList (line 69)

Returns a list of the tables that exist in the currently connected database.

  • access: public
array getTableList ()
isConnected (line 62)

Indicates whether there is an open connection to the database.

Indicates whether there is an open connection to the database.

  • return: True, if there is an open connection to the database; False, otherwise.
  • access: public
boolean isConnected ()
pConnect (line 32)

Makes a persistent database connection.

Makes a persistent database connection.

  • return: The connection's link identifier, if successful; False, otherwise.
  • access: public
mixed pConnect ()
query (line 45)

Executes an SQL query.

Executes an SQL query. The method is passed a query object, which it converts to a SQL query string using the appropriate SQLGenerator object.

  • return: The appropriate QueryResult object. If the query failed, it would return NULL.
  • access: public
mixed query (Query $query)
  • object Query $query: A Query object from which the SQL query will be constructed.
rollbackTransaction (line 153)

Roll-back a transaction manually instead of committing

  • since: 3/9/05
  • access: public
void rollbackTransaction ()
selectDatabase (line 96)

This method selects the default database to use in queries.

  • return: True, if successful; False, otherwise.
  • access: public
boolean selectDatabase (string $database)
  • string $database: database The name of the default database.
supportsTransactions (line 125)

Return TRUE if this database supports transactions.

  • since: 3/9/05
  • access: public
boolean supportsTransactions ()
toDBDate (line 106)

Converts a DateAndTime object to a proper datetime/timestamp/time representation for this Database. This function must return a string including quotes if necessary for this specific database type.

  • return: A proper datetime/timestamp/time representation for this Database.
  • access: public
mixed toDBDate (DateAndTime $dateAndTime)
  • ref $dateAndTime: object DateAndTime The DateAndTime object to convert.

Documentation generated on Wed, 19 Sep 2007 10:22:28 -0400 by phpDocumentor 1.3.0RC3