Joomla CMS  3.8.5 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.8.5 et du framework Joomla Platform intégré
Référence de la classe FOFDatabase
+ Graphe d'héritage de FOFDatabase:

Fonctions membres publiques

 query ()
 
 getErrorMsg ($escaped=false)
 
 getErrorNum ()
 
 stderr ($showSQL=false)
 

Fonctions membres publiques statiques

static getConnectors ()
 
static getInstance ($options=array())
 
static splitSql ($query)
 
static test ()
 

Description détaillée

Database connector class.

Depuis
11.1
Obsolète:
13.3 (Platform) & 4.0 (CMS)

Documentation des fonctions membres

◆ getConnectors()

static getConnectors ( )
static

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.

Renvoie
array An array of available database connectors.
Depuis
11.1
Obsolète:
13.1 (Platform) & 4.0 (CMS)

Références FOFDatabaseDriver\getConnectors().

◆ getErrorMsg()

getErrorMsg (   $escaped = false)

Gets the error message from the database connection.

Paramètres
boolean$escapedTrue to escape the message string for use in JavaScript.
Renvoie
string The error message for the most recent query.
Obsolète:
13.3 (Platform) & 4.0 (CMS)
Depuis
11.1

◆ getErrorNum()

getErrorNum ( )

Gets the error number from the database connection.

Renvoie
integer The error number for the most recent query.
Depuis
11.1
Obsolète:
13.3 (Platform) & 4.0 (CMS)

◆ getInstance()

static getInstance (   $options = array())
static

Method to return a FOFDatabaseDriver 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 FOFDatabaseDriver 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.

Paramètres
array$optionsParameters to be passed to the database driver.
Renvoie
FOFDatabaseDriver A database object.
Depuis
11.1
Obsolète:
13.1 (Platform) & 4.0 (CMS)

Références $options, et FOFDatabaseDriver\getInstance().

◆ query()

query ( )

Execute the SQL statement.

Renvoie
mixed A database cursor resource on success, boolean false on failure.
Depuis
11.1
Exceptions
RuntimeException
Obsolète:
13.1 (Platform) & 4.0 (CMS)

◆ splitSql()

static splitSql (   $query)
static

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

Paramètres
string$queryInput SQL string with which to split into individual queries.
Renvoie
array The queries from the input string separated into an array.
Depuis
11.1
Obsolète:
13.1 (Platform) & 4.0 (CMS)

Références $query, et FOFDatabaseDriver\splitSql().

◆ stderr()

stderr (   $showSQL = false)

Return the most recent error message for the database connector.

Paramètres
boolean$showSQLTrue to display the SQL statement sent to the database as well as the error.
Renvoie
string The error message for the most recent query.
Depuis
11.1
Obsolète:
13.3 (Platform) & 4.0 (CMS)

◆ test()

static test ( )
static

Test to see if the connector is available.

Renvoie
boolean True on success, false otherwise.
Depuis
11.1
Obsolète:
12.3 (Platform) & 4.0 (CMS) - Use FOFDatabaseDriver::isSupported() instead.

La documentation de cette classe a été générée à partir du fichier suivant :