Zikula: A Flexible Open Source Content Management System
home | forum | international support | contact us

Docs For Class DBConnectionStack

Class: DBConnectionStack

Source Location: /pnobjlib/DBConnectionStack.class.php

Class Overview


This class maintains a stack of database connections. Getting a connection will always return the connection object which is currently on top of the connections stack (ie: the latest added connection).

Methods


Inherited Variables

Inherited Methods


Class Details

[line 23] This class maintains a stack of database connections. Getting a connection will always return the connection object which is currently on top of the connections stack (ie: the latest added connection).



[ Top ]

Class Methods


method getConnection [line 239]

the getConnection( [fetchmod $fetchmode = ADODB_FETCH_NUM])

Get the currently active connection (the connection on top of the connection stack)



Tags:

return:  connection object


Parameters:

fetchmod   $fetchmode   The fetchmode to set for the connection

[ Top ]

method getConnectionDBDriver [line 203]

string getConnectionDBDriver( )

Get the DB driver of the currently active connection. This is not necessarily the same as the DB Type and should be used to distinguish between different database types in ADODB e.g. both oracle and oci8 use the oci8 driver to load the correct data dictionary include file



Tags:

return:  the driver of the currently active connection


[ Top ]

method getConnectionDBHost [line 179]

string getConnectionDBHost( )

Get the DB Host of the currently active connection



Tags:

return:  the host of the currently active connection


[ Top ]

method getConnectionDBName [line 168]

string getConnectionDBName( )

Get the DB Alias name of the currently active connection



Tags:

return:  the dbname of the currently active connection


[ Top ]

method getConnectionDBType [line 190]

string getConnectionDBType( )

Get the DB Type of the currently active connection



Tags:

return:  the type of the currently active connection


[ Top ]

method getConnectionInfo [line 124]

string getConnectionInfo( [name $name = null], [field $field = null])

Get the DB connection info structure for a connection as defined in config.php.

If $field is supplied, the value of the specified field is retuerned, otherwise the entire connection info array is returned.




Tags:

return:  The connection info array or the specified field value


Parameters:

name   $name   the name of the connection info to get. Passing null returns the current (ie: top) connection (optional) (default=null)
field   $field   the field of the connection info record to return

[ Top ]

method getConnectionName [line 157]

string getConnectionName( )

Get the alias name name of the currently active connection



Tags:

return:  the name of the currently active connection


[ Top ]

method init [line 32]

string init( [name $name = null])

Initialize a DBConnection and place it on the connection stack



Tags:

return:  The file name which was loaded


Parameters:

name   $name   The database alias name in the DBInfo configuration array (optional) (default=null which then defaults to 'default')

[ Top ]

method isDefaultConnection [line 225]

boolean isDefaultConnection( )

Check whether the current connection is the default one



Tags:

return:  whether or not the current connection is the default one


[ Top ]

method popConnection [line 305]

boolean popConnection( [close $close = false])

Pop the currently active connection off the stack.



Tags:

return:  The newly active connection


Parameters:

close   $close   Whether or not to close the connection (optional) (default=false)

[ Top ]

method pushConnection [line 288]

The pushConnection( name $name)

Push a new database connection onto the connection stack



Tags:

return:  database connection


Parameters:

name   $name   The database alias name in the DBInfo configuration array

[ Top ]

Packages:

Files:

Classes: