Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques statiques | |
static | isSupported () |
connect | ( | ) |
Connects to the database if needed.
Implémenté dans MysqliDriver, MysqlDriver, PdoDriver, PgsqlDriver, et SqliteDriver.
connected | ( | ) |
Determines if the connection to the server is active.
Implémenté dans PdoDriver, et MysqliDriver.
createDatabase | ( | $options, | |
$utf = true |
|||
) |
Create a new database using information from $options object.
\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. |
Implémenté dans DatabaseDriver, et SqliteDriver.
decodeBinary | ( | $data | ) |
Replace special placeholder representing binary field with the original string.
string | resource | $data | Encoded string or resource. |
Implémenté dans DatabaseDriver, et PgsqlDriver.
disconnect | ( | ) |
dropTable | ( | $table, | |
$ifExists = true |
|||
) |
Drops a table from the database.
string | $table | The name of the database table to drop. |
boolean | $ifExists | Optionally specify that the table must exist before it is dropped. |
Implémenté dans DatabaseDriver.
escape | ( | $text, | |
$extra = false |
|||
) |
Escapes a string for usage in an SQL statement.
string | $text | The string to be escaped. |
boolean | $extra | Optional parameter to provide extra escaping. |
Implémenté dans MysqlDriver, PdoDriver, MysqliDriver, et SqliteDriver.
execute | ( | ) |
Execute the SQL statement.
Implémenté dans DatabaseDriver, et PdoDriver.
getAffectedRows | ( | ) |
Get the number of affected rows for the previous executed SQL statement.
Implémenté dans DatabaseDriver.
getCollation | ( | ) |
Method to get the database collation in use by sampling a text field of a table in the database.
Implémenté dans MysqliDriver, MysqlDriver, SqliteDriver, et PgsqlDriver.
getConnection | ( | ) |
Method that provides access to the underlying database connection.
Implémenté dans DatabaseDriver.
getConnectionCollation | ( | ) |
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.
Implémenté dans MysqliDriver, MysqlDriver, SqliteDriver, et PgsqlDriver.
getConnectionEncryption | ( | ) |
Method to get the database encryption details (cipher and protocol) in use.
Implémenté dans MysqliDriver, MysqlDriver, SqliteDriver, et PgsqlDriver.
getCount | ( | ) |
Get the total number of SQL statements executed by the database driver.
Implémenté dans DatabaseDriver.
getDateFormat | ( | ) |
Returns a PHP date() function compliant date format for the database driver.
Implémenté dans DatabaseDriver.
getMinimum | ( | ) |
Get the minimum supported database version.
Implémenté dans DatabaseDriver, MysqliDriver, et MysqlDriver.
getName | ( | ) |
getNullDate | ( | ) |
Get the null or zero representation of a timestamp for the database driver.
Implémenté dans MysqliDriver, DatabaseDriver, et MysqlDriver.
getNumRows | ( | ) |
Get the number of returned rows for the previous executed SQL statement.
Implémenté dans DatabaseDriver.
getQuery | ( | $new = false | ) |
Get the current query object or a new QueryInterface object.
boolean | $new | False to return the current query object, True to return a new QueryInterface object. |
Implémenté dans DatabaseDriver.
getServerType | ( | ) |
getTableColumns | ( | $table, | |
$typeOnly = true |
|||
) |
Retrieves field information about the given tables.
string | $table | The name of the database table. |
boolean | $typeOnly | True (default) to only return field types. |
Implémenté dans MysqliDriver, MysqlDriver, SqliteDriver, et PgsqlDriver.
getTableKeys | ( | $tables | ) |
Retrieves field information about the given tables.
mixed | $tables | A table name or a list of table names. |
Implémenté dans MysqliDriver, MysqlDriver, PgsqlDriver, et SqliteDriver.
getTableList | ( | ) |
Method to get an array of all tables in the database.
Implémenté dans MysqliDriver, MysqlDriver, PgsqlDriver, et SqliteDriver.
getVersion | ( | ) |
Get the version of the database connector.
Implémenté dans MysqliDriver, PdoDriver, MysqlDriver, et SqliteDriver.
hasUtfSupport | ( | ) |
Determine whether or not the database engine supports UTF-8 character encoding.
Implémenté dans DatabaseDriver.
insertid | ( | ) |
Method to get the auto-incremented value from the last INSERT statement.
Implémenté dans MysqliDriver, et PdoDriver.
insertObject | ( | $table, | |
& | $object, | ||
$key = null |
|||
) |
Inserts a row into a table based on an object's properties.
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. |
Implémenté dans DatabaseDriver, PgsqlDriver, MysqliDriver, et MysqlDriver.
isConnectionEncryptionSupported | ( | ) |
Method to test if the database TLS connections encryption are supported.
Implémenté dans MysqliDriver, MysqlDriver, SqliteDriver, et PgsqlDriver.
isMinimumVersion | ( | ) |
Method to check whether the installed database version is supported by the database driver
Implémenté dans DatabaseDriver.
|
static |
Test to see if the connector is available.
Implémenté dans PgsqlDriver, PdoDriver, SqliteDriver, MysqliDriver, et MysqlDriver.
loadAssoc | ( | ) |
Method to get the first row of the result set from the database query as an associative array of ['field_name' => 'row_value'].
Implémenté dans DatabaseDriver.
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.
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. |
Implémenté dans DatabaseDriver.
loadColumn | ( | $offset = 0 | ) |
Method to get an array of values from the $offset field in each row of the result set from the database query.
integer | $offset | The row offset to use to build the result array. |
Implémenté dans DatabaseDriver.
loadObject | ( | $class = \stdClass::class | ) |
Method to get the first row of the result set from the database query as an object.
string | $class | The class name to use for the returned row object. |
Implémenté dans DatabaseDriver.
loadObjectList | ( | $key = '' , |
|
$class = \stdClass::class |
|||
) |
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.
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. |
Implémenté dans DatabaseDriver.
loadResult | ( | ) |
Method to get the first field of the first row of the result set from the database query.
Implémenté dans DatabaseDriver.
loadRow | ( | ) |
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.
Implémenté dans DatabaseDriver.
loadRowList | ( | $key = null | ) |
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.
string | $key | The name of a field on which to key the result array. |
Implémenté dans DatabaseDriver.
lockTable | ( | $tableName | ) |
Locks a table in the database.
string | $tableName | The name of the table to unlock. |
Implémenté dans MysqliDriver, MysqlDriver, PgsqlDriver, et SqliteDriver.
quote | ( | $text, | |
$escape = true |
|||
) |
Quotes and optionally escapes a string to database requirements for use in database queries.
array | string | $text | A string or an array of strings to quote. |
boolean | $escape | True (default) to escape the string, false to leave it unchanged. |
Implémenté dans DatabaseDriver.
quoteBinary | ( | $data | ) |
Quotes a binary string to database requirements for use in database queries.
string | $data | A binary string to quote. |
Implémenté dans DatabaseDriver, et PgsqlDriver.
quoteName | ( | $name, | |
$as = null |
|||
) |
Wrap an SQL statement identifier name such as column, table or database names in quotes to prevent injection risks and reserved word conflicts.
array | string | $name | The identifier name to wrap in quotes, or an array of identifier names to wrap in quotes. Each type supports dot-notation name. |
array | string | $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. |
Implémenté dans DatabaseDriver.
Renames a table in the database.
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 |
Implémenté dans MysqliDriver, MysqlDriver, PgsqlDriver, et SqliteDriver.
replacePrefix | ( | $sql, | |
$prefix = '#__' |
|||
) |
This function replaces a string identifier with the configured table prefix.
string | $sql | The SQL statement to prepare. |
string | $prefix | The table prefix. |
Implémenté dans DatabaseDriver, et PgsqlDriver.
select | ( | $database | ) |
Select a database for use.
string | $database | The name of the database to select for use. |
Implémenté dans MysqliDriver, PdoDriver, SqliteDriver, et MysqlDriver.
setQuery | ( | $query, | |
$offset = 0 , |
|||
$limit = 0 |
|||
) |
Sets the SQL statement string for later execution.
mixed | $query | The SQL statement to set either as a Query object or a string. |
integer | $offset | The affected row offset to set. { |
integer | $limit | The maximum affected rows to set. { |
Implémenté dans DatabaseDriver.
transactionCommit | ( | $toSavepoint = false | ) |
Method to commit a transaction.
boolean | $toSavepoint | If true, commit to the last savepoint. |
Implémenté dans MysqliDriver, MysqlDriver, PdoDriver, PgsqlDriver, et SqliteDriver.
transactionRollback | ( | $toSavepoint = false | ) |
Method to roll back a transaction.
boolean | $toSavepoint | If true, rollback to the last savepoint. |
Implémenté dans MysqliDriver, MysqlDriver, PdoDriver, PgsqlDriver, et SqliteDriver.
transactionStart | ( | $asSavepoint = false | ) |
Method to initialize a transaction.
boolean | $asSavepoint | If true and a transaction is already active, a savepoint will be created. |
Implémenté dans MysqliDriver, MysqlDriver, PdoDriver, PgsqlDriver, et SqliteDriver.
truncateTable | ( | $table | ) |
Method to truncate a table.
string | $table | The table to truncate |
Implémenté dans DatabaseDriver, et SqliteDriver.
unlockTables | ( | ) |
Unlocks tables in the database.
Implémenté dans MysqliDriver, PgsqlDriver, MysqlDriver, et SqliteDriver.
updateObject | ( | $table, | |
& | $object, | ||
$key, | |||
$nulls = false |
|||
) |
Updates a row in a table based on an object's properties.
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 | string | $key | The name of the primary key. |
boolean | $nulls | True to update null fields or false to ignore them. |
Implémenté dans DatabaseDriver, et PgsqlDriver.