tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Class: DB_Connection_Installer

Source Location: /db/db_connection_installer.class.php

Class DB_Connection_Installer

Class Overview

This class is ment to be used ONLY by module installers

DB_Connection_Installer resembles adodb_db_connection but is created with already connected db connection instead of DSN. It's purpose is to fake "normal" db connection in order module instalators to be able to use *_DBC when installing/uninstalling

Located in /db/db_connection_installer.class.php [line 40]

Tangra_Class
   |
   --DB_Connection
      |
      --DB_Connection_Installer

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From DB_Connection

DB_Connection::$autocommit
DB_Connection::$conn
DB_Connection::$connected
DB_Connection::$dsn

Inherited From DB_Connection

DB_Connection::__construct()
Constructor
DB_Connection::complete_trans()
Finishing transaction
DB_Connection::connect()
Tries to connect to DB
DB_Connection::disconnect()
Disconnects from the DB
DB_Connection::execute()
Executes SQL statemnt
DB_Connection::execute_in_trans()
Executes sql statemnt(s) in transaction
DB_Connection::fail_trans()
Manually marking transaction as failed
DB_Connection::generate_id()
Generates next id from sequence
DB_Connection::get_autocommit()
Gets autocommit mode
DB_Connection::get_conn()
Returns internal db connection object
DB_Connection::get_dsn()
Gets DB DSN
DB_Connection::get_error_msg()
Returns error message if any
DB_Connection::is_connected()
Gets $this->connected
DB_Connection::query()
Alias of execute()
DB_Connection::select_limit()
Selects limited ammount of rows
DB_Connection::set_autocommit()
Sets autocommit mode
DB_Connection::set_connected()
Sets $this->connected
DB_Connection::start_trans()
Starting transaction
DB_Connection::__destruct()
Destructor

Inherited From Tangra_Class

Tangra_Class::get_class_name()
Alias of get_class(). Exist because of historical reasons.
Tangra_Class::__set()
Overides PHP built-in method and just throws exception if called. Purpose - to "forbid" autosetting of nonexisting class properties.

[ Top ]
Method Summary
DB_Connection_Installer   __construct()   Constructor
void   __destruct()   Destructor
void   complete_trans()   Ends (commit) db transaction
boolean   connect()   Fake
void   disconnect()   Disconnects
void   execute()   Executes SQL statemen
void   fail_trans()   Fails transaction (rollback)
integer   generate_id()   Generates ID
void   get_error_msg()   Return error message (if any)
void   query()   Alias of execute
void   select_limit()   Fake
void   start_trans()   Starts db transaction

[ Top ]
Methods
Constructor __construct  [line 47]

  DB_Connection_Installer __construct( ADODB_Connection $conn  )

Constructor

Parameters:
ADODB_Connection   $conn: 


Redefinition of:
DB_Connection::__construct()
Constructor

[ Top ]
Destructor __destruct  [line 200]

  void __destruct( )

Destructor

Disconnects



Redefinition of:
DB_Connection::__destruct()
Destructor

[ Top ]
complete_trans  [line 93]

  void complete_trans( )

Ends (commit) db transaction


API Tags:
Access:  public


Redefinition of:
DB_Connection::complete_trans()
Finishing transaction

[ Top ]
connect  [line 59]

  boolean connect( )

Fake


API Tags:
Access:  public


Redefinition of:
DB_Connection::connect()
Tries to connect to DB

[ Top ]
disconnect  [line 70]

  void disconnect( )

Disconnects


API Tags:
Access:  public


Redefinition of:
DB_Connection::disconnect()
Disconnects from the DB

[ Top ]
execute  [line 108]

  void execute( string $sql  )

Executes SQL statemen

Parameters:
string   $sql: 

API Tags:
Access:  public

Information Tags:
Throws:  TE_DBC
Throws:  TE_DBC_SQL_Failed

Redefinition of:
DB_Connection::execute()
Executes SQL statemnt

[ Top ]
fail_trans  [line 168]

  void fail_trans( )

Fails transaction (rollback)


API Tags:
Access:  public


Redefinition of:
DB_Connection::fail_trans()
Manually marking transaction as failed

[ Top ]
generate_id  [line 150]

  integer generate_id( string $sequence_name, [integer $start = 1]  )

Generates ID

Parameters:
string   $sequence_name:  Name of the sequence that will be used (for MySQL where sequences are not available - name of the db table that fakes the sequence)
integer   $start:  Starting value of the sequence (will be used only if sequence does not exist yet, i.e. for initialization)

API Tags:
Return:  Generated ID
Access:  public


Redefinition of:
DB_Connection::generate_id()
Generates next id from sequence

[ Top ]
get_error_msg  [line 177]

  void get_error_msg( )

Return error message (if any)


API Tags:
Access:  public


Redefinition of:
DB_Connection::get_error_msg()
Returns error message if any

[ Top ]
query  [line 138]

  void query( string $sql  )

Alias of execute

Parameters:
string   $sql: 

API Tags:
Access:  public


Redefinition of:
DB_Connection::query()
Alias of execute()

[ Top ]
select_limit  [line 189]

  void select_limit( unknown_type $sql, unknown_type $num_rows, unknown_type $offset  )

Fake

Parameters:
unknown_type   $sql: 
unknown_type   $num_rows: 
unknown_type   $offset: 

API Tags:
Access:  public


Redefinition of:
DB_Connection::select_limit()
Selects limited ammount of rows

[ Top ]
start_trans  [line 82]

  void start_trans( )

Starts db transaction


API Tags:
Access:  public


Redefinition of:
DB_Connection::start_trans()
Starting transaction

[ Top ]