ClassInterface IConnector

Description

The IConnector interface defines the function signatures and the constants for all connector classes.

If you want your application to run with different types of databases, you may ONLY use the functions defined here.

You may implement additional IConnector classes from scratch using this interface, but that is not recommended. Mostly, you'll want to extend the abstract BaseConnector class.

Located in /IConnector.php (line 53)


	
			
Class Constant Summary
 CHAR_APPLICATION = "charApplication"
 CHAR_DATABASE = "charDatabase"
 CONN_CHARSET = "connCharset"
 CONN_DATABASE = "connDatabase"
 CONN_DRIVER = "connDriver"
 CONN_HOSTNAME = "connHostname"
 CONN_NATIVE = "connNative"
 CONN_PASSWORD = "connPassword"
 CONN_PERSISTENT = "connPersistent"
 CONN_POOL = "connPool"
 CONN_PORT = "connPort"
 CONN_USERNAME = "connUsername"
 LOG_DEBUG = "logDebug"
 LOG_ERROR = "logError"
 PARAM_CAST_NUMERIC = "paramCastNumeric"
 PARAM_NAMED = "paramNamed"
 PARAM_PREFIX = "paramPrefix"
 PARAM_QUERIES = "paramQueries"
 PARAM_STRIP_MAGIC = "paramStripMagic"
 PARAM_STRIP_TAGS = "paramStripTags"
 PARAM_TRIM = "paramTrim"
 RESULT_CACHE = "resultCache"
 RESULT_KEY_FIELD = "resultKeyField"
 RESULT_LENGTH = "resultLength"
 RESULT_OFFSET = "resultOffset"
Method Summary
 bool commit ([array $options = array()])
 int delete (string $query, [array $param = array()], [array $map = array()], [array $options = array()])
 resource getLink ()
 mixed getOptions ([string $element = null])
 int insert (string $query, [array $param = array()], [array $map = array()], [array $options = array()])
 bool rollback ([array $options = array()])
 array select (string $query, [array $param = array()], [array $map = array()], [array $options = array()])
 mixed setOptions (mixed $options, [string $element = null])
 bool transaction ([array $options = array()])
 int update (string $query, [array $param = array()], [array $map = array()], [array $options = array()])
Methods
commit (line 262)

Commits the current transaction on the current connection.

The current transaction includes all statements on the connection that were executed after the call to transaction() and before any calls to rollback() or commit().

  • return: true if the transaction was successfully committed, false otherwise.
  • access: public
bool commit ([array $options = array()])
delete (line 236)

Send a SQL DELETE query to the database and get the number of rows deleted by the query.

  • return: The number of rows deleted by the query.
  • tutorial: delete()
  • throws: Exception when $param doesn't match the type definition $map.
  • access: public
int delete (string $query, [array $param = array()], [array $map = array()], [array $options = array()])
  • string $query: A SQL query to execute on a database.
  • array $param: An associated array of values to be used in the $query.
  • array $map: An array of type definitions for the $param values.
  • array $options: An associated array of options, see the Option elements.
getLink (line 283)

Get the database link identifier used by the IConnector instance.

  • return: A PHP database link identifier.
  • access: public
resource getLink ()
getOptions (line 294)

Get an array of all currently used options or the value of the option defined in the optional $element parameter.

  • return: All options as an associated array or the value of a single option.
  • access: public
mixed getOptions ([string $element = null])
insert (line 204)

Send a SQL INSERT query to the database and get the IDENTITY ID generated from the last INSERT operation (if any).

  • return: The IDENTITY ID of the last inserted row.
  • tutorial: insert()
  • throws: Exception when $param doesn't match the type definition $map.
  • access: public
int insert (string $query, [array $param = array()], [array $map = array()], [array $options = array()])
  • string $query: A SQL query to execute on a database.
  • array $param: An associated array of values to be used in the $query.
  • array $map: An array of type definitions for the $param values.
  • array $options: An associated array of options, see the Option elements.
rollback (line 275)

Rolls back the current transaction on the current connection.

The current transaction includes all statements on the connection that were executed after the call to transaction() and before any calls to rollback() or commit().

  • return: true if the transaction was successfully rolled back, false otherwise.
  • access: public
bool rollback ([array $options = array()])
select (line 188)

Send a SQL SELECT query to the database and get the query result.

As a default, this function returns a table as a numeric array of rows. Each row is an associated array. The array keys in the rows correspond to the column names of your query.

  • return: The query result as a table (array of associated arrays).
  • tutorial: Retrieve data: select()
  • throws: Exception when $param doesn't match the type definition $map.
  • access: public
array select (string $query, [array $param = array()], [array $map = array()], [array $options = array()])
  • string $query: A SQL query to execute on a database.
  • array $param: An associated array of values to be used in the $query.
  • array $map: An array of type definitions for the $param values.
  • array $options: An associated array of options, see the Option elements.
setOptions (line 306)

Set one or more options for the IConnector instance.

Some options are only valid as constructor or function options.

  • return: The previous option value(s).
  • access: public
mixed setOptions (mixed $options, [string $element = null])
  • mixed $options: Multiple options as an associated array or the value of a single option.
  • string $element: An option constant, see the Option elements.
transaction (line 249)

Begins a transaction on the current connection.

The current transaction includes all statements on the connection that were executed after the call to transaction() and before any calls to rollback() or commit().

  • return: true if the transaction was successfully begun, false otherwise.
  • access: public
bool transaction ([array $options = array()])
update (line 220)

Send a SQL UPDATE query to the database and get the number of rows updates by the query.

  • return: The number of rows updates by the query.
  • tutorial: update()
  • throws: Exception when $param doesn't match the type definition $map.
  • access: public
int update (string $query, [array $param = array()], [array $map = array()], [array $options = array()])
  • string $query: A SQL query to execute on a database.
  • array $param: An associated array of values to be used in the $query.
  • array $map: An array of type definitions for the $param values.
  • array $options: An associated array of options, see the Option elements.
Class Constants
CHAR_APPLICATION = "charApplication" (line 94)

Set this option to the character set being used by your application.

CHAR_DATABASE = "charDatabase" (line 99)

Set this option to the character set being used by your database(s).

CONN_CHARSET = "connCharset" (line 59)

The name of the connection character set (used by MySQL).

CONN_DATABASE = "connDatabase" (line 64)

The name of the default database to use or a ODBC Data Source.

CONN_DRIVER = "connDriver" (line 86)
CONN_HOSTNAME = "connHostname" (line 69)

The name of the server host to connect to (ignored by ODBC).

CONN_NATIVE = "connNative" (line 88)
CONN_PASSWORD = "connPassword" (line 74)

The database password. Leave empty (null) to use Windows authentification.

CONN_PERSISTENT = "connPersistent" (line 79)

Opens a persistent connection to a database when true.

CONN_POOL = "connPool" (line 89)
CONN_PORT = "connPort" (line 87)
CONN_USERNAME = "connUsername" (line 84)

The database user name. Leave empty (null) to use Windows authentification.

LOG_DEBUG = "logDebug" (line 104)

Writes debug information in the php log file when true.

LOG_ERROR = "logError" (line 109)

Error information is written in the php log file when true.

PARAM_CAST_NUMERIC = "paramCastNumeric" (line 114)

Set this option to true to cast numeric strings to int or float.

PARAM_NAMED = "paramNamed" (line 119)

True, when named placeholders are used, false otherwise.

PARAM_PREFIX = "paramPrefix" (line 124)

The parameter prefix to be used in parameterized queries.

PARAM_QUERIES = "paramQueries" (line 130)

Set this option to true to send sql statements as parameterized queries to the database.

PARAM_STRIP_MAGIC = "paramStripMagic" (line 135)

Strips magic quotes from string parameters when true.

PARAM_STRIP_TAGS = "paramStripTags" (line 140)

Strips all PHP and HTML tags from string parameters when true.

PARAM_TRIM = "paramTrim" (line 145)

Removes leading and trailing white space from string parameters when true.

RESULT_CACHE = "resultCache" (line 151)

Enables internal caching of all tables (query results) returned by the select() function when true.

RESULT_KEY_FIELD = "resultKeyField" (line 158)

When defined, the select() function returns the query result table as an ASSOCIATED array of rows (which again are associated arrays).

RESULT_LENGTH = "resultLength" (line 163)

The maximum number of rows returend by the select() method.

RESULT_OFFSET = "resultOffset" (line 169)

The number of rows to skip from the beginning of query result table returned by the select() method.

Documentation generated on Wed, 03 Jun 2009 12:41:51 +0200 by phpDocumentor 1.4.1