[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/database/src/ -> DatabaseInterface.php (summary)

Part of the Joomla Framework Database Package

Copyright: Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
License: GNU General Public License version 2 or later; see LICENSE
File Size: 609 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

DatabaseInterface:: (53 methods):
  connect()
  connected()
  createDatabase()
  decodeBinary()
  disconnect()
  dropTable()
  escape()
  execute()
  getAffectedRows()
  getCollation()
  getConnection()
  getConnectionCollation()
  getConnectionEncryption()
  isConnectionEncryptionSupported()
  isMinimumVersion()
  getCount()
  getDateFormat()
  getMinimum()
  getName()
  getNullDate()
  getNumRows()
  getQuery()
  getServerType()
  getTableColumns()
  getTableKeys()
  getTableList()
  getVersion()
  hasUtfSupport()
  insertid()
  insertObject()
  isSupported()
  loadAssoc()
  loadAssocList()
  loadColumn()
  loadObject()
  loadObjectList()
  loadResult()
  loadRow()
  loadRowList()
  lockTable()
  quote()
  quoteBinary()
  quoteName()
  renameTable()
  replacePrefix()
  select()
  setQuery()
  transactionCommit()
  transactionRollback()
  transactionStart()
  truncateTable()
  unlockTables()
  updateObject()


Interface: DatabaseInterface  - X-Ref

Joomla Framework Database Interface

connect()   X-Ref
Connects to the database if needed.

return: void

connected()   X-Ref
Determines if the connection to the server is active.

return: boolean

createDatabase($options, $utf = true)   X-Ref
Create a new database using information from $options object.

param: \stdClass  $options  Object used to pass user and database name to database driver. This object must have "db_name" and "db_user" set.
param: boolean    $utf      True if the database supports the UTF-8 character set.
return: boolean|resource

decodeBinary($data)   X-Ref
Replace special placeholder representing binary field with the original string.

param: string|resource  $data  Encoded string or resource.
return: string  The original string.

disconnect()   X-Ref
Disconnects the database.

return: void

dropTable($table, $ifExists = true)   X-Ref
Drops a table from the database.

param: string   $table     The name of the database table to drop.
param: boolean  $ifExists  Optionally specify that the table must exist before it is dropped.
return: $this

escape($text, $extra = false)   X-Ref
Escapes a string for usage in an SQL statement.

param: string   $text   The string to be escaped.
param: boolean  $extra  Optional parameter to provide extra escaping.
return: string   The escaped string.

execute()   X-Ref
Execute the SQL statement.

return: boolean

getAffectedRows()   X-Ref
Get the number of affected rows for the previous executed SQL statement.

return: integer

getCollation()   X-Ref
Method to get the database collation in use by sampling a text field of a table in the database.

return: string|boolean  The collation in use by the database or boolean false if not supported.

getConnection()   X-Ref
Method that provides access to the underlying database connection.

return: resource  The underlying database connection resource.

getConnectionCollation()   X-Ref
Method to get the database connection collation, as reported by the driver.

If the connector doesn't support reporting this value please return an empty string.

return: string

getConnectionEncryption()   X-Ref
Method to get the database encryption details (cipher and protocol) in use.

return: string  The database encryption details.

isConnectionEncryptionSupported()   X-Ref
Method to test if the database TLS connections encryption are supported.

return: boolean  Whether the database supports TLS connections encryption.

isMinimumVersion()   X-Ref
Method to check whether the installed database version is supported by the database driver

return: boolean  True if the database version is supported

getCount()   X-Ref
Get the total number of SQL statements executed by the database driver.

return: integer

getDateFormat()   X-Ref
Returns a PHP date() function compliant date format for the database driver.

return: string

getMinimum()   X-Ref
Get the minimum supported database version.

return: string

getName()   X-Ref
Get the name of the database driver.

return: string

getNullDate()   X-Ref
Get the null or zero representation of a timestamp for the database driver.

return: string

getNumRows()   X-Ref
Get the number of returned rows for the previous executed SQL statement.

return: integer

getQuery($new = false)   X-Ref
Get the current query object or a new QueryInterface object.

param: boolean  $new  False to return the current query object, True to return a new QueryInterface object.
return: QueryInterface

getServerType()   X-Ref
Get the server family type.

return: string

getTableColumns($table, $typeOnly = true)   X-Ref
Retrieves field information about the given tables.

param: string   $table     The name of the database table.
param: boolean  $typeOnly  True (default) to only return field types.
return: array

getTableKeys($tables)   X-Ref
Retrieves field information about the given tables.

param: mixed  $tables  A table name or a list of table names.
return: array

getTableList()   X-Ref
Method to get an array of all tables in the database.

return: array

getVersion()   X-Ref
Get the version of the database connector.

return: string

hasUtfSupport()   X-Ref
Determine whether or not the database engine supports UTF-8 character encoding.

return: boolean  True if the database engine supports UTF-8 character encoding.

insertid()   X-Ref
Method to get the auto-incremented value from the last INSERT statement.

return: mixed  The value of the auto-increment field from the last inserted row.

insertObject($table, &$object, $key = null)   X-Ref
Inserts a row into a table based on an object's properties.

param: string  $table   The name of the database table to insert into.
param: object  $object  A reference to an object whose public properties match the table fields.
param: string  $key     The name of the primary key. If provided the object property is updated.
return: boolean

isSupported()   X-Ref
Test to see if the connector is available.

return: boolean

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

return: mixed  The return value or null if the query failed.

loadAssocList($key = null, $column = null)   X-Ref
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: Choosing to key the result array by a non-unique field name can result in unwanted
behavior and should be avoided.

param: string  $key     The name of a field on which to key the result array.
param: string  $column  An optional column name. Instead of the whole row, only this column value will be in the result array.
return: mixed   The return value or null if the query failed.

loadColumn($offset = 0)   X-Ref
Method to get an array of values from the <var>$offset</var> field in each row of the result set from the database query.

param: integer  $offset  The row offset to use to build the result array.
return: mixed  The return value or null if the query failed.

loadObject($class = \stdClass::class)   X-Ref
Method to get the first row of the result set from the database query as an object.

param: string  $class  The class name to use for the returned row object.
return: mixed  The return value or null if the query failed.

loadObjectList($key = '', $class = \stdClass::class)   X-Ref
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.

param: string  $key    The name of a field on which to key the result array.
param: string  $class  The class name to use for the returned row objects.
return: mixed  The return value or null if the query failed.

loadResult()   X-Ref
Method to get the first field of the first row of the result set from the database query.

return: mixed  The return value or null if the query failed.

loadRow()   X-Ref
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 <var>$row[0]</var>, etc.

return: mixed  The return value or null if the query failed.

loadRowList($key = null)   X-Ref
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.

param: string  $key  The name of a field on which to key the result array.
return: mixed   The return value or null if the query failed.

lockTable($tableName)   X-Ref
Locks a table in the database.

param: string  $tableName  The name of the table to unlock.
return: $this

quote($text, $escape = true)   X-Ref
Quotes and optionally escapes a string to database requirements for use in database queries.

param: array|string  $text    A string or an array of strings to quote.
param: boolean       $escape  True (default) to escape the string, false to leave it unchanged.
return: string

quoteBinary($data)   X-Ref
Quotes a binary string to database requirements for use in database queries.

param: string  $data  A binary string to quote.
return: string  The binary quoted input string.

quoteName($name, $as = null)   X-Ref
Wrap an SQL statement identifier name such as column, table or database names in quotes to prevent injection
risks and reserved word conflicts.

param: array|string  $name  The identifier name to wrap in quotes, or an array of identifier names to wrap in quotes.
param: array|string  $as    The AS query part associated to $name. It can be string or array, in latter case it has to be
return: array|string  The quote wrapped name, same type of $name.

renameTable($oldTable, $newTable, $backup = null, $prefix = null)   X-Ref
Renames a table in the database.

param: string  $oldTable  The name of the table to be renamed
param: string  $newTable  The new name for the table.
param: string  $backup    Table prefix
param: string  $prefix    For the table - used to rename constraints in non-mysql databases
return: $this

replacePrefix($sql, $prefix = ')   X-Ref
This function replaces a string identifier with the configured table prefix.

param: string  $sql     The SQL statement to prepare.
param: string  $prefix  The table prefix.
return: string  The processed SQL statement.

select($database)   X-Ref
Select a database for use.

param: string  $database  The name of the database to select for use.
return: boolean

setQuery($query, $offset = 0, $limit = 0)   X-Ref
Sets the SQL statement string for later execution.

param: mixed    $query   The SQL statement to set either as a Query object or a string.
param: integer  $offset  The affected row offset to set. {@deprecated 3.0 Use LimitableInterface::setLimit() instead}
param: integer  $limit   The maximum affected rows to set. {@deprecated 3.0 Use LimitableInterface::setLimit() instead}
return: $this

transactionCommit($toSavepoint = false)   X-Ref
Method to commit a transaction.

param: boolean  $toSavepoint  If true, commit to the last savepoint.
return: void

transactionRollback($toSavepoint = false)   X-Ref
Method to roll back a transaction.

param: boolean  $toSavepoint  If true, rollback to the last savepoint.
return: void

transactionStart($asSavepoint = false)   X-Ref
Method to initialize a transaction.

param: boolean  $asSavepoint  If true and a transaction is already active, a savepoint will be created.
return: void

truncateTable($table)   X-Ref
Method to truncate a table.

param: string  $table  The table to truncate
return: void

unlockTables()   X-Ref
Unlocks tables in the database.

return: $this

updateObject($table, &$object, $key, $nulls = false)   X-Ref
Updates a row in a table based on an object's properties.

param: string        $table   The name of the database table to update.
param: object        $object  A reference to an object whose public properties match the table fields.
param: array|string  $key     The name of the primary key.
param: boolean       $nulls   True to update null fields or false to ignore them.
return: boolean



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer