ey='' ) {
return;
}
/**
* This global function loads the first row of a query into an object
*
*
* @abstract
* @access public
* @param object
*/
function loadObject( ) {
return;
}
/**
* Load a list of database objects
*
* @abstract
* @access public
* @param string The field name of a primary key
* @return array If key is empty as sequential list of returned records.
* If key is not empty then the returned array is indexed by the value
* the database key. Returns null if the query fails.
*/
function loadObjectList( $key='' ) {
return;
}
/**
* Load the first row returned by the query
*
* @abstract
* @access public
* @return The first row of the query.
*/
function loadRow() {
return;
}
/**
* Load a list of database rows (numeric column indexing)
*
* If key is not empty then the returned array is indexed by the value
* the database key. Returns null if the query fails.
*
* @abstract
* @access public
* @param string The field name of a primary key
* @return array
*/
function loadRowList( $key='' ) {
return;
}
/**
* Inserts a row into a table based on an objects properties
* @param string The name of the table
* @param object An object whose properties match table fields
* @param string The name of the primary key. If provided the object property is updated.
*/
function insertObject( $table, &$object, $keyName = NULL ) {
return;
}
/**
* Update ab object in the database
*
* @abstract
* @access public
* @param string
* @param object
* @param string
* @param boolean
*/
function updateObject( $table, &$object, $keyName, $updateNulls=true ) {
return;
}
/**
* Print out an error statement
*
* @param boolean If TRUE, displays the last SQL statement sent to the database
* @return string A standised error message
*/
function stderr( $showSQL = false ) {
if ( $this->_errorNum != 0 ) {
return "DB function failed with error number $this->_errorNum"
."
$this->_errorMsg"
.($showSQL ? "
SQL =
$this->_sql" : ''); } else { return "DB function reports no errors"; } } /** * Get the ID generated from the previous INSERT operation * * @abstract * @access public * @return mixed */ function insertid() { return; } /** * Get the database collation * * @abstract * @access public * @return string Collation in use */ function getCollation() { return; } /** * Get the version of the database connector * * @abstract */ function getVersion() { return 'Not available for this connector'; } /** * List tables in a database * * @abstract * @access public * @return array A list of all the tables in the database */ function getTableList() { return; } /** * * * @abstract * @access public * @param array A list of table names * @return array A list the create SQL for the tables */ function getTableCreate( $tables ) { return; } /** * List database table fields * * @abstract * @access public * @param array A list of table names * @return array An array of fields by table */ function getTableFields( $tables ) { return; } // ---- // ADODB Compatibility Functions // ---- /** * Get a quoted database escaped string * * @access public * @return string */ function Quote( $text ) { return '\'' . $this->getEscaped( $text ) . '\''; } /** * ADODB compatability function * * @access public * @param string SQL * @since 1.5 */ function GetCol( $query ) { $this->setQuery( $query ); return $this->loadResultArray(); } /** * ADODB compatability function * * @access public * @param string SQL * @return object * @since 1.5 */ function Execute( $query ) { jimport( 'joomla.database.recordset' ); $query = trim( $query ); $this->setQuery( $query ); if (eregi( '^select', $query )) { $result = $this->loadRowList(); return new JRecordSet( $result ); } else { $result = $this->query(); if ($result === false) { return false; } else { return new JRecordSet( array() ); } } } /** * ADODB compatability function * * @access public * @since 1.5 */ function SelectLimit( $query, $count, $offset=0 ) { jimport( 'joomla.database.recordset' ); $this->setQuery( $query, $offset, $count ); $result = $this->loadRowList(); return new JRecordSet( $result ); } /** * ADODB compatability function * * @access public * @since 1.5 */ function PageExecute( $sql, $nrows, $page, $inputarr=false, $secs2cache=0 ) { jimport( 'joomla.database.recordset' ); $this->setQuery( $sql, $page*$nrows, $nrows ); $result = $this->loadRowList(); return new JRecordSet( $result ); } /** * ADODB compatability function * * @access public * @param string SQL * @return array * @since 1.5 */ function GetRow( $query ) { $this->setQuery( $query ); $result = $this->loadRowList(); return $result[0]; } /** * ADODB compatability function * * @access public * @param string SQL * @return mixed * @since 1.5 */ function GetOne( $query ) { $this->setQuery( $query ); $result = $this->loadResult(); return $result; } /** * ADODB compatability function * * @since 1.5 */ function BeginTrans() { } /** * ADODB compatability function * * @since 1.5 */ function RollbackTrans() { } /** * ADODB compatability function * * @since 1.5 */ function CommitTrans() { } /** * ADODB compatability function * * @since 1.5 */ function ErrorMsg() { return $this->getErrorMsg(); } /** * ADODB compatability function * * @since 1.5 */ function ErrorNo() { return $this->getErrorNum(); } /** * ADODB compatability function * * @since 1.5 */ function GenID( $foo1=null, $foo2=null ) { return '0'; } }