PHP Class CI_DB_pdo_driver, TastyIgniter

Note: _DB is an extender class that the app controller creates dynamically based on whether the active record class is being used or not.
Author: EllisLab Dev Team
Inheritance: extends CI_DB
Mostrar archivo Open project: tastyigniter/tastyigniter Class Usage Examples

Public Properties

Property Type Description
$dbdriver string Database driver
$options array PDO Options

Public Methods

Method Description
__construct ( array $params ) : void Class constructor
affected_rows ( ) : integer Affected Rows
db_connect ( boolean $persistent = FALSE ) : object Database connection
error ( ) : array Error
insert_id ( string $name = NULL ) : integer Insert ID
version ( ) : string Database version number

Protected Methods

Method Description
_escape_str ( $str ) : string Platform-dependant string escape
_execute ( string $sql ) : mixed Execute the query
_field_data ( string $table ) : string Field data query
_trans_begin ( ) : boolean Begin Transaction
_trans_commit ( ) : boolean Commit Transaction
_trans_rollback ( ) : boolean Rollback Transaction
_truncate ( string $table ) : string Truncate statement
_update_batch ( string $table, array $values, string $index ) : string Update_Batch statement

Method Details

__construct() public method

Validates the DSN string and/or detects the subdriver.
public __construct ( array $params ) : void
$params array
return void

_escape_str() protected method

Platform-dependant string escape
protected _escape_str ( $str ) : string
return string

_execute() protected method

Execute the query
protected _execute ( string $sql ) : mixed
$sql string SQL query
return mixed

_field_data() protected method

Generates a platform-specific query so that the column data can be retrieved
protected _field_data ( string $table ) : string
$table string
return string

_trans_begin() protected method

Begin Transaction
protected _trans_begin ( ) : boolean
return boolean

_trans_commit() protected method

Commit Transaction
protected _trans_commit ( ) : boolean
return boolean

_trans_rollback() protected method

Rollback Transaction
protected _trans_rollback ( ) : boolean
return boolean

_truncate() protected method

Generates a platform-specific truncate string from the supplied data If the database does not support the TRUNCATE statement, then this method maps to 'DELETE FROM table'
protected _truncate ( string $table ) : string
$table string
return string

_update_batch() protected method

Generates a platform-specific batch update string from the supplied data
protected _update_batch ( string $table, array $values, string $index ) : string
$table string Table name
$values array Update data
$index string WHERE key
return string

affected_rows() public method

Affected Rows
public affected_rows ( ) : integer
return integer

db_connect() public method

Database connection
public db_connect ( boolean $persistent = FALSE ) : object
$persistent boolean
return object

error() public method

Returns an array containing code and message of the last database error that has occured.
public error ( ) : array
return array

insert_id() public method

Insert ID
public insert_id ( string $name = NULL ) : integer
$name string
return integer

version() public method

Database version number
public version ( ) : string
return string

Property Details

$dbdriver public_oe property

Database driver
public string $dbdriver
return string

$options public_oe property

PDO Options
public array $options
return array