DboAdodb Class Reference

Inheritance diagram for DboAdodb:

DboSource DataSource Object

List of all members.


Public Member Functions

 _execute ($sql)
 begin (&$model)
 buildColumn ($column)
 column ($real)
 commit (&$model)
 connect ()
 describe (&$model)
 disconnect ()
 fetchResult ()
 fetchRow ($sql=null)
 fields (&$model, $alias=null, $fields=array(), $quote=true)
 hasResult ()
 lastAffected ()
 lastError ()
 lastInsertId ()
 lastNumRows ()
 limit ($limit, $offset=null)
 listSources ()
 resultSet (&$results)
 rollback (&$model)
 value ($data, $column=null, $safe=false)

Public Attributes

 $_adodb = null
 $_adodbColumnTypes
 $columns
 $description = "ADOdb DBO Driver"

Detailed Description

Definition at line 44 of file dbo_adodb.php.


Member Function Documentation

DboAdodb::_execute ( sql  ) 

Executes given SQL statement.

Parameters:
string $sql SQL statement
Returns:
resource Result resource identifier

Definition at line 136 of file dbo_adodb.php.

DboAdodb::begin ( &$  model  ) 

Begin a transaction

Parameters:
unknown_type $model
Returns:
boolean True on success, false on fail (i.e. if the database/model does not support transactions).

Reimplemented from DboSource.

Definition at line 174 of file dbo_adodb.php.

DboAdodb::buildColumn ( column  ) 

Generate a database-native column schema string

Parameters:
array $column An array structured like the following: array('name'=>'value', 'type'=>'value'[, options]), where options can be 'default', 'length', or 'key'.
Returns:
string

Reimplemented from DboSource.

Definition at line 450 of file dbo_adodb.php.

References $out, DboSource::length(), limit(), DboSource::name(), and value().

DboAdodb::column ( real  ) 

Converts database-layer column types to basic types

Parameters:
string $real Real database-layer column type (i.e. "varchar(255)")
Returns:
string Abstract column type (i.e. "string")

Reimplemented from DataSource.

Definition at line 324 of file dbo_adodb.php.

Referenced by describe().

DboAdodb::commit ( &$  model  ) 

Commit a transaction

Parameters:
unknown_type $model
Returns:
boolean True on success, false on fail (i.e. if the database/model does not support transactions, or a transaction has not started).

Reimplemented from DboSource.

Definition at line 191 of file dbo_adodb.php.

DboAdodb::connect (  ) 

Connects to the database using options in the given configuration array.

Parameters:
array $config Configuration array for connecting

Definition at line 99 of file dbo_adodb.php.

References DataSource::$config, and config().

DboAdodb::describe ( &$  model  ) 

Returns an array of the fields in the table used by the given model.

Parameters:
AppModel $model Model object
Returns:
array Fields in table. Keys are name and type

Definition at line 232 of file dbo_adodb.php.

References column(), DboSource::fullTableName(), and DboSource::length().

DboAdodb::disconnect (  ) 

Disconnects from database.

Returns:
boolean True if the database could be disconnected, else false

Definition at line 127 of file dbo_adodb.php.

DboAdodb::fetchResult (  ) 

Fetches the next row from the current result set

Returns:
unknown

Definition at line 427 of file dbo_adodb.php.

Referenced by fetchRow().

DboAdodb::fetchRow ( sql = null  ) 

Returns a row from given resultset as an array .

Returns:
array The fetched row as an array Returns a row from current resultset as an array .

array The fetched row as an array

Reimplemented from DboSource.

Definition at line 151 of file dbo_adodb.php.

References DboSource::execute(), fetchResult(), hasResult(), and resultSet().

DboAdodb::fields ( &$  model,
alias = null,
fields = array(),
quote = true 
)

Generates the fields list of an SQL query.

Parameters:
Model $model
string $alias Alias tablename
mixed $fields
Returns:
array

Reimplemented from DboSource.

Definition at line 366 of file dbo_adodb.php.

References DboSource::$alias, and DboSource::name().

DboAdodb::hasResult (  ) 

Checks if the result is valid

Returns:
boolean True if the result is valid, else false

Reimplemented from DboSource.

Definition at line 517 of file dbo_adodb.php.

Referenced by fetchRow().

DboAdodb::lastAffected (  ) 

Returns number of affected rows in previous database operation, or false if no previous operation exists.

Returns:
integer Number of affected rows

Definition at line 271 of file dbo_adodb.php.

DboAdodb::lastError (  ) 

Returns a formatted error message from previous database operation.

Returns:
string Error message

Definition at line 263 of file dbo_adodb.php.

DboAdodb::lastInsertId (  ) 

Returns the ID generated from the previous INSERT operation.

Returns:
int
the last autonumbering ID inserted. Returns false if function not supported.

Definition at line 289 of file dbo_adodb.php.

DboAdodb::lastNumRows (  ) 

Returns number of rows in previous resultset, or false if no previous resultset exists.

Returns:
integer Number of rows in resultset

Definition at line 279 of file dbo_adodb.php.

DboAdodb::limit ( limit,
offset = null 
)

Returns a LIMIT statement in the correct format for the particular database.

Parameters:
integer $limit Limit of results returned
integer $offset Offset from which to start results
Returns:
string SQL limit/offset statement
Todo:
Please change output string to whatever select your database accepts. adodb doesn't allow us to get the correct limit string out of it.

Reimplemented from DboSource.

Definition at line 300 of file dbo_adodb.php.

Referenced by buildColumn().

DboAdodb::listSources (  ) 

Returns an array of tables in the database. If there are no tables, an error is raised and the application exits.

Returns:
array Array of tablenames in the database

Definition at line 217 of file dbo_adodb.php.

DboAdodb::resultSet ( &$  results  ) 

Build ResultSets and map data

Parameters:
array $results

Definition at line 402 of file dbo_adodb.php.

References DboSource::$index.

Referenced by fetchRow().

DboAdodb::rollback ( &$  model  ) 

Rollback a transaction

Parameters:
unknown_type $model
Returns:
boolean True on success, false on fail (i.e. if the database/model does not support transactions, or a transaction has not started).

Reimplemented from DboSource.

Definition at line 206 of file dbo_adodb.php.

DboAdodb::value ( data,
column = null,
safe = false 
)

Returns a quoted and escaped string of $data for use in an SQL statement.

Parameters:
string $data String to be prepared for use in an SQL statement
string $column_type The type of the column into which this data will be inserted
boolean $safe Whether or not numeric data should be handled automagically if no column data is provided
Returns:
string Quoted and escaped data

Definition at line 342 of file dbo_adodb.php.

Referenced by buildColumn().


Member Data Documentation

DboAdodb::$_adodb = null

Definition at line 57 of file dbo_adodb.php.

DboAdodb::$_adodbColumnTypes

Initial value:

 array(
        'string' => 'C',
        'text' => 'X',
        'date' => 'D',
        'timestamp' => 'T',
        'time' => 'T',
        'datetime' => 'T',
        'boolean' => 'L',
        'float' => 'N',
        'integer' => 'I',
        'binary' => 'R',
    )

Definition at line 64 of file dbo_adodb.php.

DboAdodb::$columns

Initial value:

 array(
        'primary_key' => array('name' => 'R', 'limit' => 11),
        'string' => array('name' => 'C', 'limit' => '255'),
        'text' => array('name' => 'X'),
        'integer' => array('name' => 'I', 'limit' => '11', 'formatter' => 'intval'),
        'float' => array('name' => 'N', 'formatter' => 'floatval'),
        'timestamp' => array('name' => 'T', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'),
        'time' => array('name' => 'T',  'format' => 'H:i:s', 'formatter' => 'date'),
        'datetime' => array('name' => 'T', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'),
        'date' => array('name' => 'D', 'format' => 'Y-m-d', 'formatter' => 'date'),
        'binary' => array('name' => 'B'),
        'boolean' => array('name' => 'L', 'limit' => '1')
    )

Definition at line 81 of file dbo_adodb.php.

DboAdodb::$description = "ADOdb DBO Driver"

Reimplemented from DboSource.

Definition at line 50 of file dbo_adodb.php.


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