Abstract Class JDatabaseDriver

Description

Implements interfaces:

Joomla Platform Database Driver Class

  • method: string q(): q($text, $escape = true) Alias for quote method
  • method: string qn(): qn($name, $as = null) Alias for quoteName method
  • abstract:
  • since: 12.1

Located in /libraries/joomla/database/driver.php (line 41)

JDatabase
   |
   --JDatabaseDriver
Direct descendents
Class Description
 class JDatabaseDriverMysqli MySQLi database driver
Abstract class JDatabaseDriverPdo Joomla Platform PDO Database Driver Class
 class JDatabaseDriverPostgresql PostgreSQL database driver
 class JDatabaseDriverSqlsrv SQL Server database driver
Variable Summary
 static string $dbMinimum
 static array $instances
 array $callStacks
 resource $connection
 integer $count
 resource $cursor
 boolean $debug
 callable[] $disconnectHandlers
 string $errorMsg
 integer $errorNum
 integer $limit
 array $log
 string $name
 string $nameQuote
 string $nullDate
 integer $offset
 array $options
 mixed $sql
 string $tablePrefix
 array $timings
 boolean $utf
Method Summary
 static array getConnectors ()
 static JDatabaseDriver getInstance ([array $options = array()])
 static array splitSql (string $sql)
 JDatabaseDriver __construct (array $options)
 void addDisconnectHandler (callable $callable)
 string alterDbCharacterSet (string $dbName)
 void connect ()
 boolean connected ()
 string createDatabase (stdClass $options, [boolean $utf = true])
 void disconnect ()
 JDatabaseDriver dropTable (string $table, [boolean $ifExists = true])
 string escape (string $text, [boolean $extra = false])
 mixed execute ()
 mixed fetchArray ([mixed $cursor = null])
 mixed fetchAssoc ([mixed $cursor = null])
 mixed fetchObject ([mixed $cursor = null], [string $class = 'stdClass'])
 void freeResult ([mixed $cursor = null])
 integer getAffectedRows ()
 string getAlterDbCharacterSet (string $dbName)
 array getCallStacks ()
 mixed getCollation ()
 resource getConnection ()
 integer getCount ()
 string getCreateDatabaseQuery (stdClass $options, boolean $utf)
 string getDatabase ()
 string getDateFormat ()
 JDatabaseIterator getIterator ([string $column = null], [string $class = 'stdClass'])
 array getLog ()
 string getMinimum ()
 string getNullDate ()
 integer getNumRows ([resource $cursor = null])
 string getPrefix ()
 JDatabaseQuery getQuery ([boolean $new = false])
 array getTableColumns (string $table, [boolean $typeOnly = true])
 array getTableCreate (mixed $tables)
 array getTableKeys (mixed $tables)
 array getTableList ()
 array getTimings ()
 boolean getUTFSupport ()
 string getVersion ()
 boolean hasUTFSupport ()
 mixed insertid ()
 boolean insertObject (string $table, object &$object, [string $key = null])
 boolean isMinimumVersion ()
 mixed loadAssoc ()
 mixed loadAssocList ([string $key = null], [string $column = null])
 mixed loadColumn ([integer $offset = 0])
 mixed loadNextObject ([string $class = 'stdClass'])
 mixed loadNextRow ()
 mixed loadObject ([string $class = 'stdClass'])
 mixed loadObjectList ([string $key = ''], [string $class = 'stdClass'])
 mixed loadResult ()
 mixed loadRow ()
 mixed loadRowList ([string $key = null])
 JDatabaseDriver lockTable (string $tableName)
 string quote (mixed $text, [boolean $escape = true])
 mixed quoteName (mixed $name, [mixed $as = null])
 string quoteNameStr (array $strArr)
 JDatabaseDriver renameTable (string $oldTable, string $newTable, [string $backup = null], [string $prefix = null])
 string replacePrefix (string $sql, [string $prefix = '#__'])
 boolean select (string $database)
 boolean setDebug (boolean $level)
 JDatabaseDriver setQuery (mixed $query, [integer $offset = 0], [integer $limit = 0])
 boolean setUTF ()
 void transactionCommit ([boolean $toSavepoint = false])
 void transactionRollback ([boolean $toSavepoint = false])
 void transactionStart ([boolean $asSavepoint = false])
 void truncateTable (string $table)
 boolean updateObject (string $table, object &$object, array $key, [boolean $nulls = false])
 mixed __call (string $method, array $args)
Variables
static string $dbMinimum (line 177)
  • var: The minimum supported database version.
  • since: 12.1
  • access: protected

Redefined in descendants as:
static array $instances = array() (line 171)
  • var: JDatabaseDriver instances container.
  • since: 11.1
  • access: protected
array $callStacks = array() (line 105)
  • var: The log of executed SQL statements timings (start and stop microtimes) by the database driver.
  • since: CMS 3.1.2
  • access: protected
resource $connection (line 63)
  • var: The database connection resource.
  • since: 11.1
  • access: protected
integer $count = 0 (line 69)
  • var: The number of SQL statements executed by the database driver.
  • since: 11.1
  • access: protected
resource $cursor (line 75)
  • var: The database connection cursor from the last query.
  • since: 11.1
  • access: protected
boolean $debug = false (line 81)
  • var: The database driver debugging state.
  • since: 11.1
  • access: protected
callable[] $disconnectHandlers = array() (line 189)
  • var: List of callables to call just before disconnecting database
  • since: CMS 3.1.2
  • access: protected
string $errorMsg (line 165)
  • var: The database error message
  • deprecated: 12.1
  • since: 11.1
  • access: protected
integer $errorNum = 0 (line 158)
  • var: The database error number
  • deprecated: 12.1
  • since: 11.1
  • access: protected
integer $limit = 0 (line 87)
  • var: The affected row limit for the current SQL statement.
  • since: 11.1
  • access: protected
array $log = array() (line 93)
  • var: The log of executed SQL statements by the database driver.
  • since: 11.1
  • access: protected
string $name (line 57)

The name of the database driver.

  • since: 11.1
  • access: public

Redefined in descendants as:
string $nameQuote (line 114)
  • var: The character(s) used to quote SQL statement names such as table names or field names, etc. The child classes should define this as necessary. If a single character string the same character is used for both sides of the quoted name, else the first character will be used for the opening quote and the second for the closing quote.
  • since: 11.1
  • access: protected

Redefined in descendants as:
  • JDatabaseDriverMysqli::$nameQuote : The character(s) used to quote SQL statement names such as table names or field names, etc. The child classes should define this as necessary. If a single character string the same character is used for both sides of the quoted name, else the first character will be used for the opening quote and the second for the closing quote.
  • JDatabaseDriverPdo::$nameQuote : The character(s) used to quote SQL statement names such as table names or field names, etc. The child classes should define this as necessary. If a single character string the same character is used for both sides of the quoted name, else the first character will be used for the opening quote and the second for the closing quote.
  • JDatabaseDriverOracle::$nameQuote : The character(s) used to quote SQL statement names such as table names or field names, etc. The child classes should define this as necessary. If a single character string the same character is used for both sides of the quoted name, else the first character will be used for the opening quote and the second for the closing quote.
  • JDatabaseDriverSqlite::$nameQuote : The character(s) used to quote SQL statement names such as table names or field names, etc. The child classes should define this as necessary. If a single character string the same character is used for both sides of the quoted name, else the first character will be used for the opening quote and the second for the closing quote.
  • JDatabaseDriverPostgresql::$nameQuote : Quote for named objects
  • JDatabaseDriverSqlsrv::$nameQuote : The character(s) used to quote SQL statement names such as table names or field names, etc. The child classes should define this as necessary. If a single character string the same character is used for both sides of the quoted name, else the first character will be used for the opening quote and the second for the closing quote.
string $nullDate (line 121)
  • var: The null or zero representation of a timestamp for the database driver. This should be defined in child classes to hold the appropriate value for the engine.
  • since: 11.1
  • access: protected

Redefined in descendants as:
integer $offset = 0 (line 127)
  • var: The affected row offset to apply for the current SQL statement.
  • since: 11.1
  • access: protected
array $options (line 133)
  • var: Passed in upon instantiation and saved.
  • since: 11.1
  • access: protected
mixed $sql (line 139)
  • var: The current SQL statement to execute.
  • since: 11.1
  • access: protected
string $tablePrefix (line 145)
  • var: The common database table prefix.
  • since: 11.1
  • access: protected
array $timings = array() (line 99)
  • var: The log of executed SQL statements timings (start and stop microtimes) by the database driver.
  • since: CMS 3.1.2
  • access: protected
integer $transactionDepth = 0 (line 183)
  • var: The depth of the current transaction.
  • since: 12.3
  • access: protected
boolean $utf = true (line 151)
  • var: True if the database engine supports UTF-8 character encoding.
  • since: 11.1
  • access: protected
Methods
static getConnectors (line 200)

Get a list of available database connectors. The list will only be populated with connectors that both the class exists and the static test method returns true. This gives us the ability to have a multitude of connector classes that are self-aware as to whether or not they are able to be used on a given system.

  • return: An array of available database connectors.
  • since: 11.1
  • access: public
static array getConnectors ()

Redefinition of:
JDatabase::getConnectors()
Get a list of available database connectors. The list will only be populated with connectors that both the class exists and the static test method returns true. This gives us the ability to have a multitude of connector classes that are self-aware as to whether or not they are able to be used on a given system.
static getInstance (line 255)

Method to return a JDatabaseDriver instance based on the given options. There are three global options and then

the rest are specific to the database driver. The 'driver' option defines which JDatabaseDriver class is used for the connection -- the default is 'mysqli'. The 'database' option determines which database is to be used for the connection. The 'select' option determines whether the connector should automatically select the chosen database.

Instances are unique to the given options and new objects are only created when a unique options array is passed into the method. This ensures that we don't end up with unnecessary database connection resources.

  • return: A database object.
  • throws: RuntimeException
  • since: 11.1
  • access: public
static JDatabaseDriver getInstance ([array $options = array()])
  • array $options: Parameters to be passed to the database driver.

Redefinition of:
JDatabase::getInstance()
Method to return a JDatabaseDriver instance based on the given options. There are three global options and then
static splitSql (line 304)

Splits a string of multiple queries into an array of individual queries.

  • return: The queries from the input string separated into an array.
  • since: 11.1
  • access: public
static array splitSql (string $sql)
  • string $sql: Input SQL string with which to split into individual queries.

Redefinition of:
JDatabase::splitSql()
Splits a string of multiple queries into an array of individual queries.
Constructor __construct (line 388)

Constructor.

  • since: 11.1
  • access: public
JDatabaseDriver __construct (array $options)
  • array $options: List of options used to configure the connection

Redefined in descendants as:
addDisconnectHandler (line 494)

Adds a function callable just before disconnecting the database. Parameter of the callable is $this JDatabaseDriver

  • since: CMS 3.1.2
  • access: public
void addDisconnectHandler (callable $callable)
  • callable $callable: Function to call in disconnect() method just before disconnecting from database
alterDbCharacterSet (line 412)

Alter database's character set, obtaining query string from protected member.

  • return: The query that alter the database query string
  • since: 12.2
  • throws: RuntimeException
  • access: public
string alterDbCharacterSet (string $dbName)
  • string $dbName: The database name that will be altered
connect (line 432)

Connects to the database if needed.

  • return: Returns void if the database connected successfully.
  • abstract:
  • throws: RuntimeException
  • since: 12.1
  • access: public
void connect ()

Redefined in descendants as:
connected (line 441)

Determines if the connection to the server is active.

  • return: True if connected to the database engine.
  • abstract:
  • since: 11.1
  • access: public
boolean connected ()

Redefined in descendants as:
createDatabase (line 456)

Create a new database using information from $options object, obtaining query string from protected member.

  • return: The query that creates database
  • since: 12.2
  • throws: RuntimeException
  • access: public
string createDatabase (stdClass $options, [boolean $utf = true])
  • stdClass $options: Object used to pass user and database name to database driver. This object must have "db_name" and "db_user" set.
  • boolean $utf: True if the database supports the UTF-8 character set.
disconnect (line 483)

Disconnects the database.

  • abstract:
  • since: 12.1
  • access: public
void disconnect ()

Redefined in descendants as:
dropTable (line 510)

Drops a table from the database.

  • return: Returns this object to support chaining.
  • abstract:
  • throws: RuntimeException
  • since: 11.4
  • access: public
JDatabaseDriver dropTable (string $table, [boolean $ifExists = true])
  • string $table: The name of the database table to drop.
  • boolean $ifExists: Optionally specify that the table must exist before it is dropped.

Redefined in descendants as:
escape (line 522)

Escapes a string for usage in an SQL statement.

  • return: The escaped string.
  • abstract:
  • since: 11.1
  • access: public
string escape (string $text, [boolean $extra = false])
  • string $text: The string to be escaped.
  • boolean $extra: Optional parameter to provide extra escaping.

Redefined in descendants as:
execute (line 1802)

Execute the SQL statement.

  • return: A database cursor resource on success, boolean false on failure.
  • abstract:
  • throws: RuntimeException
  • since: 12.1
  • access: public
mixed execute ()

Redefined in descendants as:
fetchArray (line 533)

Method to fetch a row from the result set cursor as an array.

  • return: Either the next row from the result set or false if there are no more rows.
  • abstract:
  • since: 11.1
  • access: protected
mixed fetchArray ([mixed $cursor = null])
  • mixed $cursor: The optional result set cursor from which to fetch the row.

Redefined in descendants as:
fetchAssoc (line 544)

Method to fetch a row from the result set cursor as an associative array.

  • return: Either the next row from the result set or false if there are no more rows.
  • abstract:
  • since: 11.1
  • access: protected
mixed fetchAssoc ([mixed $cursor = null])
  • mixed $cursor: The optional result set cursor from which to fetch the row.

Redefined in descendants as:
fetchObject (line 556)

Method to fetch a row from the result set cursor as an object.

  • return: Either the next row from the result set or false if there are no more rows.
  • abstract:
  • since: 11.1
  • access: protected
mixed fetchObject ([mixed $cursor = null], [string $class = 'stdClass'])
  • mixed $cursor: The optional result set cursor from which to fetch the row.
  • string $class: The class name to use for the returned row object.

Redefined in descendants as:
freeResult (line 567)

Method to free up the memory used for the result set.

  • abstract:
  • since: 11.1
  • access: protected
void freeResult ([mixed $cursor = null])
  • mixed $cursor: The optional result set cursor from which to fetch the row.

Redefined in descendants as:
getAffectedRows (line 576)

Get the number of affected rows for the previous executed SQL statement.

  • return: The number of affected rows.
  • abstract:
  • since: 11.1
  • access: public
integer getAffectedRows ()

Redefined in descendants as:
getAlterDbCharacterSet (line 587)

Return the query string to alter the database character set.

  • return: The query that alter the database query string
  • since: 12.2
  • access: protected
string getAlterDbCharacterSet (string $dbName)
  • string $dbName: The database name

Redefined in descendants as:
getCallStacks (line 702)

Get the database driver SQL statement log.

  • return: SQL statements executed by the database driver.
  • since: CMS 3.1.2
  • access: public
array getCallStacks ()
getCollation (line 620)

Method to get the database collation in use by sampling a text field of a table in the database.

  • return: The collation in use by the database or boolean false if not supported.
  • abstract:
  • since: 11.1
  • access: public
mixed getCollation ()

Redefined in descendants as:
getConnection (line 630)

Method that provides access to the underlying database connection. Useful for when you need to call a proprietary method such as postgresql's lo_* methods.

  • return: The underlying database connection resource.
  • since: 11.1
  • access: public
resource getConnection ()
getCount (line 642)

Get the total number of SQL statements executed by the database driver.

  • since: 11.1
  • access: public
integer getCount ()
getCreateDatabaseQuery (line 604)

Return the query string to create new Database.

Each database driver, other than MySQL, need to override this member to return correct string.

  • return: The query that creates database
  • since: 12.2
  • access: protected
string getCreateDatabaseQuery (stdClass $options, boolean $utf)
  • stdClass $options: Object used to pass user and database name to database driver. This object must have "db_name" and "db_user" set.
  • boolean $utf: True if the database supports the UTF-8 character set.
getDatabase (line 654)

Gets the name of the database used by this conneciton.

  • since: 11.4
  • access: protected
string getDatabase ()
getDateFormat (line 666)

Returns a PHP date() function compliant date format for the database driver.

  • return: The format string.
  • since: 11.1
  • access: public
string getDateFormat ()

Redefined in descendants as:
getExporter (line 762)

Gets an exporter class object.

  • return: An exporter object.
  • since: 12.1
  • throws: RuntimeException
  • access: public
JDatabaseExporter getExporter ()
getImporter (line 788)

Gets an importer class object.

  • return: An importer object.
  • since: 12.1
  • throws: RuntimeException
  • access: public
JDatabaseImporter getImporter ()
getIterator (line 849)

Get a new iterator on the current query.

  • return: A new database iterator.
  • since: 12.1
  • throws: RuntimeException
  • access: public
JDatabaseIterator getIterator ([string $column = null], [string $class = 'stdClass'])
  • string $column: An option column to use as the iterator key.
  • string $class: The class of object that is returned.
getLog (line 678)

Get the database driver SQL statement log.

  • return: SQL statements executed by the database driver.
  • since: 11.1
  • access: public
array getLog ()
getMinimum (line 714)

Get the minimum supported database version.

  • return: The minimum version number for the database driver.
  • since: 12.1
  • access: public
string getMinimum ()
getNullDate (line 726)

Get the null or zero representation of a timestamp for the database driver.

  • return: Null or zero representation of a timestamp.
  • since: 11.1
  • access: public
string getNullDate ()
getNumRows (line 740)

Get the number of returned rows for the previous executed SQL statement.

  • return: The number of returned rows.
  • abstract:
  • since: 11.1
  • access: public
integer getNumRows ([resource $cursor = null])
  • resource $cursor: An optional database cursor resource to extract the row count from.

Redefined in descendants as:
getPrefix (line 749)

Get the common table prefix for the database driver.

  • return: The common database table prefix.
  • since: 11.1
  • access: public
string getPrefix ()
getQuery (line 816)

Get the current query object or a new JDatabaseQuery object.

  • return: The current query object or a new object extending the JDatabaseQuery class.
  • since: 11.1
  • throws: RuntimeException
  • access: public
JDatabaseQuery getQuery ([boolean $new = false])
  • boolean $new: False to return the current query object, True to return a new JDatabaseQuery object.

Redefined in descendants as:
getTableColumns (line 876)

Retrieves field information about the given tables.

  • return: An array of fields by table.
  • abstract:
  • throws: RuntimeException
  • since: 11.1
  • access: public
array getTableColumns (string $table, [boolean $typeOnly = true])
  • string $table: The name of the database table.
  • boolean $typeOnly: True (default) to only return field types.

Redefined in descendants as:
getTableCreate (line 888)

Shows the table CREATE statement that creates the given tables.

  • return: A list of the create SQL for the tables.
  • abstract:
  • throws: RuntimeException
  • since: 11.1
  • access: public
array getTableCreate (mixed $tables)
  • mixed $tables: A table name or a list of table names.

Redefined in descendants as:
getTableKeys (line 900)

Retrieves field information about the given tables.

  • return: An array of keys for the table(s).
  • abstract:
  • throws: RuntimeException
  • since: 11.1
  • access: public
array getTableKeys (mixed $tables)
  • mixed $tables: A table name or a list of table names.

Redefined in descendants as:
getTableList (line 910)

Method to get an array of all tables in the database.

  • return: An array of all the tables in the database.
  • abstract:
  • throws: RuntimeException
  • since: 11.1
  • access: public
array getTableList ()

Redefined in descendants as:
getTimings (line 690)

Get the database driver SQL statement log.

  • return: SQL statements executed by the database driver.
  • since: CMS 3.1.2
  • access: public
array getTimings ()
getUTFSupport (line 920)

Determine whether or not the database engine supports UTF-8 character encoding.

  • return: True if the database engine supports UTF-8 character encoding.
  • deprecated: 12.3 (Platform) & 4.0 (CMS) - Use hasUTFSupport() instead
  • since: 11.1
  • access: public
boolean getUTFSupport ()
getVersion (line 945)

Get the version of the database connector

  • return: The database connector version.
  • abstract:
  • since: 11.1
  • access: public
string getVersion ()

Redefined in descendants as:
hasUTFSupport (line 933)

Determine whether or not the database engine supports UTF-8 character encoding.

  • return: True if the database engine supports UTF-8 character encoding.
  • since: 12.1
  • access: public
boolean hasUTFSupport ()
insertid (line 954)

Method to get the auto-incremented value from the last INSERT statement.

  • return: The value of the auto-increment field from the last inserted row.
  • abstract:
  • since: 11.1
  • access: public
mixed insertid ()

Redefined in descendants as:
insertObject (line 968)

Inserts a row into a table based on an object's properties.

  • return: True on success.
  • since: 11.1
  • throws: RuntimeException
  • access: public
boolean insertObject (string $table, object &$object, [string $key = null])
  • string $table: The name of the database table to insert into.
  • object &$object: A reference to an object whose public properties match the table fields.
  • string $key: The name of the primary key. If provided the object property is updated.

Redefined in descendants as:
isMinimumVersion (line 1025)

Method to check whether the installed database version is supported by the database driver

  • return: True if the database version is supported
  • since: 12.1
  • access: public
boolean isMinimumVersion ()
loadAssoc (line 1039)

Method to get the first row of the result set from the database query as an associative array of ['field_name' => 'row_value'].

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: RuntimeException
  • access: public
mixed loadAssoc ()
loadAssocList (line 1080)

Method to get an array of the result set rows from the database query where each row is an associative array of ['field_name' => 'row_value']. The array of rows can optionally be keyed by a field name, but defaults to a sequential numeric array.

NOTE: Chosing to key the result array by a non-unique field name can result in unwanted behavior and should be avoided.

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: RuntimeException
  • access: public
mixed loadAssocList ([string $key = null], [string $column = null])
  • string $key: The name of a field on which to key the result array.
  • string $column: An optional column name. Instead of the whole row, only this column value will be in the result array.
loadColumn (line 1124)

Method to get an array of values from the $offset field in each row of the result set from the database query.

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: RuntimeException
  • access: public
mixed loadColumn ([integer $offset = 0])
  • integer $offset: The row offset to use to build the result array.
loadNextObject (line 1158)

Method to get the next row in the result set from the database query as an object.

  • return: The result of the query as an array, false if there are no more rows.
  • since: 11.1
  • throws: RuntimeException
  • access: public
mixed loadNextObject ([string $class = 'stdClass'])
  • string $class: The class name to use for the returned row object.

Redefined in descendants as:
loadNextRow (line 1196)

Method to get the next row in the result set from the database query as an array.

  • return: The result of the query as an array, false if there are no more rows.
  • deprecated: N/A (CMS) Use JDatabaseDriver::getIterator() instead
  • throws: RuntimeException
  • since: 11.1
  • access: public
mixed loadNextRow ()

Redefined in descendants as:
loadObject (line 1235)

Method to get the first row of the result set from the database query as an object.

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: RuntimeException
  • access: public
mixed loadObject ([string $class = 'stdClass'])
  • string $class: The class name to use for the returned row object.
loadObjectList (line 1274)

Method to get an array of the result set rows from the database query where each row is an object. The array of objects can optionally be keyed by a field name, but defaults to a sequential numeric array.

NOTE: Choosing to key the result array by a non-unique field name can result in unwanted behavior and should be avoided.

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: RuntimeException
  • access: public
mixed loadObjectList ([string $key = ''], [string $class = 'stdClass'])
  • string $key: The name of a field on which to key the result array.
  • string $class: The class name to use for the returned row objects.
loadResult (line 1313)

Method to get the first field of the first row of the result set from the database query.

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: RuntimeException
  • access: public
mixed loadResult ()

Redefined in descendants as:
loadRow (line 1346)

Method to get the first row of the result set from the database query as an array. Columns are indexed numerically so the first column in the result set would be accessible via $row[0], etc.

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: RuntimeException
  • access: public
mixed loadRow ()
loadRowList (line 1384)

Method to get an array of the result set rows from the database query where each row is an array. The array of objects can optionally be keyed by a field offset, but defaults to a sequential numeric array.

NOTE: Choosing to key the result array by a non-unique field can result in unwanted behavior and should be avoided.

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: RuntimeException
  • access: public
mixed loadRowList ([string $key = null])
  • string $key: The name of a field on which to key the result array.
lockTable (line 1425)

Locks a table in the database.

  • return: Returns this object to support chaining.
  • abstract:
  • throws: RuntimeException
  • since: 11.4
  • access: public
JDatabaseDriver lockTable (string $tableName)
  • string $tableName: The name of the table to unlock.

Redefined in descendants as:
quote (line 1438)

Quotes and optionally escapes a string to database requirements for use in database queries.

  • return: The quoted input string.
  • since: 11.1
  • access: public
string quote (mixed $text, [boolean $escape = true])
  • mixed $text: A string or an array of strings to quote.
  • boolean $escape: True (default) to escape the string, false to leave it unchanged.
quoteName (line 1468)

Wrap an SQL statement identifier name such as column, table or database names in quotes to prevent injection risks and reserved word conflicts.

  • return: The quote wrapped name, same type of $name.
  • since: 11.1
  • access: public
mixed quoteName (mixed $name, [mixed $as = null])
  • mixed $name: The identifier name to wrap in quotes, or an array of identifier names to wrap in quotes. Each type supports dot-notation name.
  • mixed $as: The AS query part associated to $name. It can be string or array, in latter case it has to be same length of $name; if is null there will not be any AS part for string or array element.
quoteNameStr (line 1518)

Quote strings coming from quoteName call.

  • return: Dot-imploded string of quoted parts.
  • since: 11.3
  • access: protected
string quoteNameStr (array $strArr)
  • array $strArr: Array of strings coming from quoteName dot-explosion.
renameTable (line 1591)

Renames a table in the database.

  • return: Returns this object to support chaining.
  • abstract:
  • throws: RuntimeException
  • since: 11.4
  • access: public
JDatabaseDriver renameTable (string $oldTable, string $newTable, [string $backup = null], [string $prefix = null])
  • string $oldTable: The name of the table to be renamed
  • string $newTable: The new name for the table.
  • string $backup: Table prefix
  • string $prefix: For the table - used to rename constraints in non-mysql databases

Redefined in descendants as:
replacePrefix (line 1554)

This function replaces a string identifier $prefix with the string held is the tablePrefix class variable.

  • return: The processed SQL statement.
  • since: 11.1
  • access: public
string replacePrefix (string $sql, [string $prefix = '#__'])
  • string $sql: The SQL statement to prepare.
  • string $prefix: The common table prefix.

Redefined in descendants as:
select (line 1603)

Select a database for use.

  • return: True if the database was successfully selected.
  • abstract:
  • throws: RuntimeException
  • since: 11.1
  • access: public
boolean select (string $database)
  • string $database: The name of the database to select for use.

Redefined in descendants as:
setDebug (line 1614)

Sets the database debugging state for the driver.

  • return: The old debugging level.
  • since: 11.1
  • access: public
boolean setDebug (boolean $level)
  • boolean $level: True to enable debugging.
setQuery (line 1633)

Sets the SQL statement string for later execution.

  • return: This object to support method chaining.
  • since: 11.1
  • access: public
JDatabaseDriver setQuery (mixed $query, [integer $offset = 0], [integer $limit = 0])
  • mixed $query: The SQL statement to set either as a JDatabaseQuery object or a string.
  • integer $offset: The affected row offset to set.
  • integer $limit: The maximum affected rows to set.

Redefined in descendants as:
setUTF (line 1657)

Set the connection to use UTF-8 character encoding.

  • return: True on success.
  • abstract:
  • since: 11.1
  • access: public
boolean setUTF ()

Redefined in descendants as:
transactionCommit (line 1669)

Method to commit a transaction.

  • abstract:
  • throws: RuntimeException
  • since: 11.1
  • access: public
void transactionCommit ([boolean $toSavepoint = false])
  • boolean $toSavepoint: If true, commit to the last savepoint.

Redefined in descendants as:
transactionRollback (line 1681)

Method to roll back a transaction.

  • abstract:
  • throws: RuntimeException
  • since: 11.1
  • access: public
void transactionRollback ([boolean $toSavepoint = false])
  • boolean $toSavepoint: If true, rollback to the last savepoint.

Redefined in descendants as:
transactionStart (line 1693)

Method to initialize a transaction.

  • abstract:
  • throws: RuntimeException
  • since: 11.1
  • access: public
void transactionStart ([boolean $asSavepoint = false])
  • boolean $asSavepoint: If true and a transaction is already active, a savepoint will be created.

Redefined in descendants as:
truncateTable (line 1705)

Method to truncate a table.

  • since: 11.3
  • throws: RuntimeException
  • access: public
void truncateTable (string $table)
  • string $table: The table to truncate
unlockTables (line 1812)

Unlocks tables in the database.

  • return: Returns this object to support chaining.
  • abstract:
  • throws: RuntimeException
  • since: 11.4
  • access: public
JDatabaseDriver unlockTables ()

Redefined in descendants as:
updateObject (line 1724)

Updates a row in a table based on an object's properties.

  • return: True on success.
  • since: 11.1
  • throws: RuntimeException
  • access: public
boolean updateObject (string $table, object &$object, array $key, [boolean $nulls = false])
  • string $table: The name of the database table to update.
  • object &$object: A reference to an object whose public properties match the table fields.
  • array $key: The name of the primary key.
  • boolean $nulls: True to update null fields or false to ignore them.

Redefined in descendants as:
__call (line 363)

Magic method to provide method alias support for quote() and quoteName().

  • return: The aliased method's return value or null.
  • since: 11.1
  • access: public
mixed __call (string $method, array $args)
  • string $method: The called method.
  • array $args: The array of arguments passed to the method.

Inherited Methods

Inherited From JDatabase

 JDatabase::getConnectors()
 JDatabase::getErrorMsg()
 JDatabase::getErrorNum()
 JDatabase::getInstance()
 JDatabase::query()
 JDatabase::splitSql()
 JDatabase::stderr()
 JDatabase::test()

Documentation generated on Tue, 19 Nov 2013 15:01:42 +0100 by phpDocumentor 1.4.3