XOOPS  2.6.0
XoopsDatabaseManager Class Reference

Public Member Functions

 __construct ()
 
 copyFields ($fieldsMap, $oTableName, $nTableName, $dropTable=false)
 
 createDB ()
 
 dbExists ()
 
 deleteTables ($tables)
 
 fetchArray ($ret)
 
 insert ($table, $query)
 
 isConnectable ()
 
 isError ()
 
 prefix ($table)
 
 query ($sql)
 
 queryFromFile ($sql_file_path, $force=false)
 
 report ()
 
 tableExists ($table)
 

Public Attributes

 $db
 
 $failureStrings = array()
 
 $successStrings = array()
 

Private Attributes

 $f_tables = array()
 
 $s_tables = array()
 

Detailed Description

Definition at line 27 of file manager.php.

Constructor & Destructor Documentation

Member Function Documentation

XoopsDatabaseManager::copyFields (   $fieldsMap,
  $oTableName,
  $nTableName,
  $dropTable = false 
)

This method allows to copy fields from one table to another

Parameters
array$fieldsMapMap of the fields ex: array('oldfieldname' => 'newfieldname');
string$oTableNameOld Table
string$nTableNameNew Table
bool$dropTableDrop old Table
Returns
this does not return anything

Definition at line 359 of file manager.php.

References $result, and $sql.

XoopsDatabaseManager::createDB ( )

creates a database table

Returns
bool return if successful

Definition at line 103 of file manager.php.

References $result, and XoopsBaseConfig\get().

Here is the call graph for this function:

XoopsDatabaseManager::dbExists ( )

Checks if a database exists

Returns
bool returns if exists

Definition at line 93 of file manager.php.

XoopsDatabaseManager::deleteTables (   $tables)

Deletes tables

No callers found in core. foreach loop is suspect, using key and value for a list of tables? No docs or examples about what it is supposed to do.

Parameters
array$tablestable to delete
Returns
array list of dropped tables

Definition at line 316 of file manager.php.

XoopsDatabaseManager::fetchArray (   $ret)

fetches an array

Parameters
string$retresource that was returned from query
Returns
array returns the array

Definition at line 260 of file manager.php.

XoopsDatabaseManager::insert (   $table,
  $query 
)

Inserts into a table

Parameters
string$tabletable to insert into
string$queryquery to use to insert
Returns
bool|void

Definition at line 274 of file manager.php.

References $query.

XoopsDatabaseManager::isConnectable ( )

Is the database connectable?

Returns
bool is it connectable?

Definition at line 83 of file manager.php.

XoopsDatabaseManager::isError ( )

return the error

Returns
bool

Definition at line 301 of file manager.php.

XoopsDatabaseManager::prefix (   $table)

Setup prefix table

Parameters
string$tabletable to prefix
Returns
string prefixed table

Definition at line 247 of file manager.php.

XoopsDatabaseManager::query (   $sql)

runs a query

Parameters
string$sqlsql statement to perform
Returns
resource

Definition at line 234 of file manager.php.

References $sql.

XoopsDatabaseManager::queryFromFile (   $sql_file_path,
  $force = false 
)

Loads a query from a file

Parameters
string$sql_file_pathname of file to read
bool$forceweither to force the query or not
Returns
bool

Definition at line 120 of file manager.php.

References XoopsLoad\fileExists(), SqlUtility\prefixQuery(), and SqlUtility\splitMySqlFile().

Here is the call graph for this function:

XoopsDatabaseManager::report ( )

returns a report

Returns
string

Definition at line 197 of file manager.php.

References $content.

XoopsDatabaseManager::tableExists (   $table)

Checks to see if table exists

Parameters
string$tablename of database table looking for
Returns
bool true if exists or false if doesnt

Definition at line 336 of file manager.php.

References $sql.

Member Data Documentation

XoopsDatabaseManager::$db

Definition at line 42 of file manager.php.

XoopsDatabaseManager::$f_tables = array()
private

Definition at line 37 of file manager.php.

XoopsDatabaseManager::$failureStrings = array()

Definition at line 52 of file manager.php.

XoopsDatabaseManager::$s_tables = array()
private

Definition at line 32 of file manager.php.

XoopsDatabaseManager::$successStrings = array()

Definition at line 47 of file manager.php.


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