Agile Toolkit  4.2
Agile Toolkit is a powerful web development framework. Inspired by GUI Applications development
DB Class Reference
Inheritance diagram for DB:
AbstractController AbstractObject DB_prefixed

Public Member Functions

 connect ($dsn=null)
 dsql ($class=null)
 query ($query, $params=array())
 getOne ($query, $params=array())
 lastID ($statement=null, $table=null)
 beginTransaction ()
 commit ()
 inTransaction ()
 rollBack ($option=null)

Data Fields

 $dbh = null
 $type = null
 $dsql_class = 'DB_dsql'
 $transaction_depth = 0

Detailed Description

Implementation of PDO support in Agile Toolkit

Use: $this->api->dbConnect(); $query = $this->api->db->dsql();

Member Function Documentation

commit ( )
connect ( dsn = null)

we need to move dsn parsing to init, as other wise db->dsql() is creating new object of class DB_dsql instead of DB_dsql_$driver, as $this->dsql_class was set in connect, which is called after db->dsql() connection to the database. Reads config from file. $dsn may be array

dsql ( class = null)

Returns Dynamic Query object compatible with this database driver (PDO)

Reimplemented in DB_prefixed.

getOne ( query,
params = array() 

Executes query and returns first column of first row

lastID ( statement = null,
table = null 

Returns last ID after insert. Driver-dependant. Redefine if needed.

query ( query,
params = array() 

Query database with SQL statement

rollBack ( option = null)

Field Documentation

$dbh = null

Link to PDO database handle

$dsql_class = 'DB_dsql'
$transaction_depth = 0
$type = null

Contains name of the PDO driver used such as "mysql", "sqlite" etc

The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Enumerations