DboSqlite Class Reference

Inheritance diagram for DboSqlite:

DboSource DataSource Object

List of all members.


Public Member Functions

 _execute ($sql)
 begin (&$model)
 column ($real)
 commit (&$model)
 connect ()
 describe (&$model)
 disconnect ()
 fetchResult ()
 insertMulti ($table, $fields, $values)
 lastAffected ()
 lastError ()
 lastInsertId ()
 lastNumRows ()
 limit ($limit, $offset=null)
 listSources ()
 resultSet (&$results)
 rollback (&$model)
 value ($data, $column=null, $safe=false)

Public Attributes

 $_baseConfig
 $columns
 $description = "SQLite DBO Driver"
 $endQuote = '"'
 $startQuote = '"'

Detailed Description

Definition at line 38 of file dbo_sqlite.php.


Member Function Documentation

DboSqlite::_execute ( sql  ) 

Executes given SQL statement.

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

Definition at line 114 of file dbo_sqlite.php.

DboSqlite::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 DataSource.

Definition at line 211 of file dbo_sqlite.php.

References DboSource::execute().

DboSqlite::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 298 of file dbo_sqlite.php.

References limit(), and DboSource::name().

Referenced by describe().

DboSqlite::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 DataSource.

Definition at line 228 of file dbo_sqlite.php.

References DboSource::execute().

DboSqlite::connect (  ) 

Connects to the database using config['database'] as a filename.

Parameters:
array $config Configuration array for connecting
Returns:
mixed

Definition at line 92 of file dbo_sqlite.php.

References DataSource::$config.

DboSqlite::describe ( &$  model  ) 

Returns an array of the fields in given table name.

Parameters:
string $tableName Name of database table to inspect
Returns:
array Fields in table. Keys are name and type

Definition at line 154 of file dbo_sqlite.php.

References column(), DboSource::fetchAll(), and DboSource::name().

DboSqlite::disconnect (  ) 

Disconnects from database.

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

Definition at line 103 of file dbo_sqlite.php.

DboSqlite::fetchResult (  ) 

Fetches the next row from the current result set

Returns:
unknown

Definition at line 355 of file dbo_sqlite.php.

References DboSource::$index.

DboSqlite::insertMulti ( table,
fields,
values 
)

Inserts multiple values into a join table

Parameters:
string $table
string $fields
array $values

Reimplemented from DboSource.

Definition at line 402 of file dbo_sqlite.php.

References DboSource::query().

DboSqlite::lastAffected (  ) 

Returns number of affected rows in previous database operation. If no previous operation exists, this returns false.

Returns:
int Number of affected rows

Definition at line 266 of file dbo_sqlite.php.

DboSqlite::lastError (  ) 

Returns a formatted error message from previous database operation.

Returns:
string Error message

Definition at line 254 of file dbo_sqlite.php.

References DataSource::$error.

DboSqlite::lastInsertId (  ) 

Returns the ID generated from the previous INSERT operation.

Returns:
int

Definition at line 289 of file dbo_sqlite.php.

DboSqlite::lastNumRows (  ) 

Returns number of rows in previous resultset. If no previous resultset exists, this returns false.

Returns:
int Number of rows in resultset

Definition at line 278 of file dbo_sqlite.php.

DboSqlite::limit ( limit,
offset = null 
)

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

Parameters:
int $limit Limit of results returned
int $offset Offset from which to start results
Returns:
string SQL limit/offset statement

Reimplemented from DboSource.

Definition at line 381 of file dbo_sqlite.php.

Referenced by column().

DboSqlite::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 122 of file dbo_sqlite.php.

References DboSource::fetchAll(), and DboSource::name().

DboSqlite::resultSet ( &$  results  ) 

Enter description here...

Parameters:
unknown_type $results

Definition at line 331 of file dbo_sqlite.php.

References DboSource::$index.

DboSqlite::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 DataSource.

Definition at line 243 of file dbo_sqlite.php.

References DboSource::execute().

DboSqlite::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
Returns:
string Quoted and escaped

Definition at line 179 of file dbo_sqlite.php.

References $data, and DboSource::boolean().


Member Data Documentation

DboSqlite::$_baseConfig

Initial value:

 array(
        'persistent' => true,
        'database' => null,
        'connect' => 'sqlite_popen'
    )

Reimplemented from DataSource.

Definition at line 63 of file dbo_sqlite.php.

DboSqlite::$columns

Initial value:

 array(
        'primary_key' => array('name' => 'integer primary key'),
        'string' => array('name' => 'varchar', 'limit' => '255'),
        'text' => array('name' => 'text'),
        'integer' => array('name' => 'integer', 'limit' => '11', 'formatter' => 'intval'),
        'float' => array('name' => 'float', 'formatter' => 'floatval'),
        'datetime' => array('name' => 'timestamp', 'format' => 'YmdHis', 'formatter' => 'date'),
        'timestamp' => array('name' => 'timestamp', 'format' => 'YmdHis', 'formatter' => 'date'),
        'time' => array('name' => 'timestamp', 'format' => 'His', 'formatter' => 'date'),
        'date' => array('name' => 'date', 'format' => 'Ymd', 'formatter' => 'date'),
        'binary' => array('name' => 'blob'),
        'boolean' => array('name' => 'integer', 'limit' => '1')
    )

Definition at line 73 of file dbo_sqlite.php.

DboSqlite::$description = "SQLite DBO Driver"

Reimplemented from DboSource.

Definition at line 45 of file dbo_sqlite.php.

DboSqlite::$endQuote = '"'

Reimplemented from DboSource.

Definition at line 57 of file dbo_sqlite.php.

DboSqlite::$startQuote = '"'

Reimplemented from DboSource.

Definition at line 51 of file dbo_sqlite.php.


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