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

Fonctions membres publiques

 __construct ( $options)
 
 __destruct ()
 
 connect ()
 
 disconnect ()
 
 escape ($text, $extra=false)
 
 connected ()
 
 dropTable ($tableName, $ifExists=true)
 
 getAffectedRows ()
 
 getCollation ()
 
 getConnectionCollation ()
 
 getNumRows ($cur=null)
 
 getQuery ($new=false, $asObj=false)
 
 getTableCreate ($tables)
 
 getTableColumns ($table, $typeOnly=true)
 
 getTableKeys ($table)
 
 getTableList ()
 
 getTableSequences ($table)
 
 getVersion ()
 
 insertid ()
 
 lockTable ($tableName)
 
 execute ()
 
 renameTable ($oldTable, $newTable, $backup=null, $prefix=null)
 
 select ($database)
 
 setUtf ()
 
 sqlValue ($columns, $field_name, $field_value)
 
 transactionCommit ($toSavepoint=false)
 
 transactionRollback ($toSavepoint=false)
 
 transactionStart ($asSavepoint=false)
 
 insertObject ($table, &$object, $key=null)
 
 showTables ()
 
 getStringPositionSql ( $substring, $string)
 
 getRandom ()
 
 getAlterDbCharacterSet ( $dbName)
 
 getCreateDbQuery ($options, $utf)
 
 replacePrefix ($query, $prefix='#__')
 
 releaseTransactionSavepoint ( $savepointName)
 
 transactionSavepoint ( $savepointName)
 
 unlockTables ()
 
 updateObject ($table, &$object, $key, $nulls=false)
 
- Fonctions membres publiques hérités de FOFDatabaseDriver
 __call ($method, $args)
 
 __construct ($options)
 
 alterDbCharacterSet ($dbName)
 
 alterTableCharacterSet ($tableName, $rethrow=false)
 
 connect ()
 
 connected ()
 
 createDatabase ($options, $utf=true)
 
 disconnect ()
 
 addDisconnectHandler ($callable)
 
 dropTable ($table, $ifExists=true)
 
 escape ($text, $extra=false)
 
 getAffectedRows ()
 
 getAlterDbCharacterSet ($dbName)
 
 getAlterTableCharacterSet ($tableName)
 
 convertUtf8mb4QueryToUtf8 ($query)
 
 getCollation ()
 
 getConnectionCollation ()
 
 getConnection ()
 
 getCount ()
 
 getDateFormat ()
 
 getLog ()
 
 getTimings ()
 
 getCallStacks ()
 
 getMinimum ()
 
 getNullDate ()
 
 getNumRows ($cursor=null)
 
 getPrefix ()
 
 getExporter ()
 
 getImporter ()
 
 getName ()
 
 getServerType ()
 
 getQuery ($new=false)
 
 getIterator ($column=null, $class='stdClass')
 
 getTableColumns ($table, $typeOnly=true)
 
 getTableCreate ($tables)
 
 getTableKeys ($tables)
 
 getTableList ()
 
 getUTFSupport ()
 
 hasUTFSupport ()
 
 hasUTF8mb4Support ()
 
 getVersion ()
 
 insertid ()
 
 insertObject ($table, &$object, $key=null)
 
 isMinimumVersion ()
 
 loadAssoc ()
 
 loadAssocList ($key=null, $column=null)
 
 loadColumn ($offset=0)
 
 loadNextObject ($class='stdClass')
 
 loadNextRow ()
 
 loadObject ($class='stdClass')
 
 loadObjectList ($key='', $class='stdClass')
 
 loadResult ()
 
 loadRow ()
 
 loadRowList ($key=null)
 
 lockTable ($tableName)
 
 quote ($text, $escape=true)
 
 quoteName ($name, $as=null)
 
 replacePrefix ($sql, $prefix='#__')
 
 renameTable ($oldTable, $newTable, $backup=null, $prefix=null)
 
 select ($database)
 
 setDebug ($level)
 
 setQuery ($query, $offset=0, $limit=0)
 
 setUtf ()
 
 transactionCommit ($toSavepoint=false)
 
 transactionRollback ($toSavepoint=false)
 
 transactionStart ($asSavepoint=false)
 
 truncateTable ($table)
 
 updateObject ($table, &$object, $key, $nulls=false)
 
 execute ()
 
 unlockTables ()
 
- Fonctions membres publiques hérités de FOFDatabase
 query ()
 
 getErrorMsg ($escaped=false)
 
 getErrorNum ()
 
 stderr ($showSQL=false)
 

Fonctions membres publiques statiques

static test ()
 
static isSupported ()
 
- Fonctions membres publiques statiques hérités de FOFDatabaseDriver
static getConnectors ()
 
static getInstance ($options=array())
 
static splitSql ($sql)
 
- Fonctions membres publiques statiques hérités de FOFDatabase
static getConnectors ()
 
static getInstance ($options=array())
 
static splitSql ($query)
 
static test ()
 

Champs de données

 $name = 'postgresql'
 
 $serverType = 'postgresql'
 
- Champs de données hérités de FOFDatabaseDriver
 $name
 
 $serverType
 

Fonctions membres protégées

 fetchArray ($cursor=null)
 
 fetchAssoc ($cursor=null)
 
 fetchObject ($cursor=null, $class='stdClass')
 
 freeResult ($cursor=null)
 
 getErrorNumber ()
 
 getErrorMessage ($query)
 
- Fonctions membres protégées hérités de FOFDatabaseDriver
 fetchArray ($cursor=null)
 
 fetchAssoc ($cursor=null)
 
 fetchObject ($cursor=null, $class='stdClass')
 
 freeResult ($cursor=null)
 
 getCreateDatabaseQuery ($options, $utf)
 
 getDatabase ()
 
 quoteNameStr ($strArr)
 

Attributs protégés

 $nameQuote = '"'
 
 $nullDate = '1970-01-01 00:00:00'
 
 $concat_operator = '||'
 
 $queryObject = null
 
- Attributs protégés hérités de FOFDatabaseDriver
 $connection
 
 $count = 0
 
 $cursor
 
 $debug = false
 
 $limit = 0
 
 $log = array()
 
 $timings = array()
 
 $callStacks = array()
 
 $nameQuote
 
 $nullDate
 
 $offset = 0
 
 $options
 
 $sql
 
 $tablePrefix
 
 $utf = true
 
 $utf8mb4 = false
 
 $errorNum = 0
 
 $errorMsg
 
 $transactionDepth = 0
 
 $disconnectHandlers = array()
 

Attributs protégés statiques

static $dbMinimum = '8.3.18'
 
- Attributs protégés statiques hérités de FOFDatabaseDriver
static $instances = array()
 
static $dbMinimum
 

Description détaillée

PostgreSQL database driver

Depuis
12.1

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $options)

Database object constructor

Paramètres
array$optionsList of options used to configure the connection
Depuis
12.1

Références $options.

◆ __destruct()

__destruct ( )

Database object destructor

Depuis
12.1

Documentation des fonctions membres

◆ connect()

connect ( )

Connects to the database if needed.

Renvoie
void Returns void if the database connected successfully.
Depuis
12.1
Exceptions
RuntimeException

◆ connected()

connected ( )

Determines if the connection to the server is active.

Renvoie
boolean
Depuis
12.1

◆ disconnect()

disconnect ( )

Disconnects the database.

Renvoie
void
Depuis
12.1

Références null.

◆ dropTable()

dropTable (   $tableName,
  $ifExists = true 
)

Drops a table from the database.

Paramètres
string$tableNameThe name of the database table to drop.
boolean$ifExistsOptionally specify that the table must exist before it is dropped.
Renvoie
boolean
Depuis
12.1
Exceptions
RuntimeException

◆ escape()

escape (   $text,
  $extra = false 
)

Method to escape a string for usage in an SQL statement.

Paramètres
string$textThe string to be escaped.
boolean$extraOptional parameter to provide extra escaping.
Renvoie
string The escaped string.
Depuis
12.1

Références $text.

◆ execute()

execute ( )

Execute the SQL statement.

Renvoie
mixed A database cursor resource on success, boolean false on failure.
Depuis
12.1
Exceptions
RuntimeException

Références $offset, $query, et null.

◆ fetchArray()

fetchArray (   $cursor = null)
protected

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

Paramètres
mixed$cursorThe optional result set cursor from which to fetch the row.
Renvoie
mixed Either the next row from the result set or false if there are no more rows.
Depuis
12.1

◆ fetchAssoc()

fetchAssoc (   $cursor = null)
protected

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

Paramètres
mixed$cursorThe optional result set cursor from which to fetch the row.
Renvoie
mixed Either the next row from the result set or false if there are no more rows.
Depuis
12.1

◆ fetchObject()

fetchObject (   $cursor = null,
  $class = 'stdClass' 
)
protected

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

Paramètres
mixed$cursorThe optional result set cursor from which to fetch the row.
string$classThe class name to use for the returned row object.
Renvoie
mixed Either the next row from the result set or false if there are no more rows.
Depuis
12.1

Références $class, et null.

◆ freeResult()

freeResult (   $cursor = null)
protected

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

Paramètres
mixed$cursorThe optional result set cursor from which to fetch the row.
Renvoie
void
Depuis
12.1

◆ getAffectedRows()

getAffectedRows ( )

Get the number of affected rows by the last INSERT, UPDATE, REPLACE or DELETE for the previous executed SQL statement.

Renvoie
integer The number of affected rows in the previous operation
Depuis
12.1

◆ getAlterDbCharacterSet()

getAlterDbCharacterSet (   $dbName)

Get the query string to alter the database character set.

Paramètres
string$dbNameThe database name
Renvoie
string The query that alter the database query string
Depuis
12.1

Références $query.

◆ getCollation()

getCollation ( )

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

Renvoie
mixed The collation in use by the database or boolean false if not supported.
Depuis
12.1
Exceptions
RuntimeException

◆ getConnectionCollation()

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.

Renvoie
string

◆ getCreateDbQuery()

getCreateDbQuery (   $options,
  $utf 
)

Get the query string to create new Database in correct PostgreSQL syntax.

Paramètres
object$optionsobject coming from "initialise" function to pass user and database name to database driver.
boolean$utfTrue if the database supports the UTF-8 character set, not used in PostgreSQL "CREATE DATABASE" query.
Renvoie
string The query that creates database, owned by $options['user']
Depuis
12.1

Références $options, et $query.

◆ getErrorMessage()

getErrorMessage (   $query)
protected

Return the actual SQL Error message

Paramètres
string$queryThe SQL Query that fails
Renvoie
string The SQL Error message
Depuis
3.4.6

Références $query.

◆ getErrorNumber()

getErrorNumber ( )
protected

Return the actual SQL Error number

Renvoie
integer The SQL Error number
Depuis
3.4.6

◆ getNumRows()

getNumRows (   $cur = null)

Get the number of returned rows for the previous executed SQL statement. This command is only valid for statements like SELECT or SHOW that return an actual result set. To retrieve the number of rows affected by a INSERT, UPDATE, REPLACE or DELETE query, use getAffectedRows().

Paramètres
resource$curAn optional database cursor resource to extract the row count from.
Renvoie
integer The number of returned rows.
Depuis
12.1

◆ getQuery()

getQuery (   $new = false,
  $asObj = false 
)

Get the current or query, or new FOFDatabaseQuery object.

Paramètres
boolean$newFalse to return the last query set, True to return a new FOFDatabaseQuery object.
boolean$asObjFalse to return last query as string, true to get FOFDatabaseQueryPostgresql object.
Renvoie
FOFDatabaseQuery The current query object or a new object extending the FOFDatabaseQuery class.
Depuis
12.1
Exceptions
RuntimeException

◆ getRandom()

getRandom ( )

Generate a random value

Renvoie
float The random generated number
Depuis
12.1

◆ getStringPositionSql()

getStringPositionSql (   $substring,
  $string 
)

Get the substring position inside a string

Paramètres
string$substringThe string being sought
string$stringThe string/column being searched
Renvoie
integer The position of $substring in $string
Depuis
12.1

Références $position, et $query.

◆ getTableColumns()

getTableColumns (   $table,
  $typeOnly = true 
)

Retrieves field information about a given table.

Paramètres
string$tableThe name of the database table.
boolean$typeOnlyTrue to only return field types.
Renvoie
array An array of fields for the database table.
Depuis
12.1
Exceptions
RuntimeException

Références $field, $fields, et null.

◆ getTableCreate()

getTableCreate (   $tables)

Shows the table CREATE statement that creates the given tables.

This is unsupported by PostgreSQL.

Paramètres
mixed$tablesA table name or a list of table names.
Renvoie
string An empty char because this function is not supported by PostgreSQL.
Depuis
12.1

◆ getTableKeys()

getTableKeys (   $table)

Get the details list of keys for a table.

Paramètres
string$tableThe name of the table.
Renvoie
array An array of the column specification for the table.
Depuis
12.1
Exceptions
RuntimeException

◆ getTableList()

getTableList ( )

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

Renvoie
array An array of all the tables in the database.
Depuis
12.1
Exceptions
RuntimeException

Références $query.

◆ getTableSequences()

getTableSequences (   $table)

Get the details list of sequences for a table.

Paramètres
string$tableThe name of the table.
Renvoie
array An array of sequences specification for the table.
Depuis
12.1
Exceptions
RuntimeException

Références $name, et $query.

◆ getVersion()

getVersion ( )

Get the version of the database connector.

Renvoie
string The database connector version.
Depuis
12.1

Références $version.

◆ insertid()

insertid ( )

◆ insertObject()

insertObject (   $table,
$object,
  $key = null 
)

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

Paramètres
string$tableThe name of the database table to insert into.
object&$objectA reference to an object whose public properties match the table fields.
string$keyThe name of the primary key. If provided the object property is updated.
Renvoie
boolean True on success.
Depuis
12.1
Exceptions
RuntimeException

Références $columns, $fields, $id, $key, $query, et null.

◆ isSupported()

static isSupported ( )
static

Test to see if the PostgreSQL connector is available.

Renvoie
boolean True on success, false otherwise.
Depuis
12.1

Implémente JDatabaseInterface.

◆ lockTable()

lockTable (   $tableName)

Locks a table in the database.

Paramètres
string$tableNameThe name of the table to unlock.
Renvoie
FOFDatabaseDriverPostgresql Returns this object to support chaining.
Depuis
12.1
Exceptions
RuntimeException

◆ releaseTransactionSavepoint()

releaseTransactionSavepoint (   $savepointName)

Method to release a savepoint.

Paramètres
string$savepointNameSavepoint's name to release
Renvoie
void
Depuis
12.1

◆ renameTable()

renameTable (   $oldTable,
  $newTable,
  $backup = null,
  $prefix = null 
)

Renames a table in the database.

Paramètres
string$oldTableThe name of the table to be renamed
string$newTableThe new name for the table.
string$backupNot used by PostgreSQL.
string$prefixNot used by PostgreSQL.
Renvoie
FOFDatabaseDriverPostgresql Returns this object to support chaining.
Depuis
12.1
Exceptions
RuntimeException

◆ replacePrefix()

replacePrefix (   $query,
  $prefix = '#__' 
)

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

Paramètres
string$queryThe SQL statement to prepare.
string$prefixThe common table prefix.
Renvoie
string The processed SQL statement.
Depuis
12.1

Références $prefix, et $query.

◆ select()

select (   $database)

Selects the database, but redundant for PostgreSQL

Paramètres
string$databaseDatabase name to select.
Renvoie
boolean Always true
Depuis
12.1

◆ setUtf()

setUtf ( )

Custom settings for UTF support

Renvoie
integer Zero on success, -1 on failure
Depuis
12.1

◆ showTables()

showTables ( )

Returns an array containing database's table list.

Renvoie
array The database's table list.
Depuis
12.1

Références $query.

◆ sqlValue()

sqlValue (   $columns,
  $field_name,
  $field_value 
)

This function return a field value as a prepared string to be used in a SQL statement.

Paramètres
array$columnsArray of table's column returned by ::getTableColumns.
string$field_nameThe table field's name.
string$field_valueThe variable value to quote and return.
Renvoie
string The quoted string.
Depuis
12.1

Références $columns, et elseif.

◆ test()

static test ( )
static

Test to see if the PostgreSQL connector is available

Renvoie
boolean True on success, false otherwise.
Depuis
12.1

◆ transactionCommit()

transactionCommit (   $toSavepoint = false)

Method to commit a transaction.

Paramètres
boolean$toSavepointIf true, commit to the last savepoint.
Renvoie
void
Depuis
12.1
Exceptions
RuntimeException

◆ transactionRollback()

transactionRollback (   $toSavepoint = false)

Method to roll back a transaction.

Paramètres
boolean$toSavepointIf true, rollback to the last savepoint.
Renvoie
void
Depuis
12.1
Exceptions
RuntimeException

◆ transactionSavepoint()

transactionSavepoint (   $savepointName)

Method to create a savepoint.

Paramètres
string$savepointNameSavepoint's name to create
Renvoie
void
Depuis
12.1

◆ transactionStart()

transactionStart (   $asSavepoint = false)

Method to initialize a transaction.

Paramètres
boolean$asSavepointIf true and a transaction is already active, a savepoint will be created.
Renvoie
void
Depuis
12.1
Exceptions
RuntimeException

◆ unlockTables()

unlockTables ( )

Unlocks tables in the database, this command does not exist in PostgreSQL, it is automatically done on commit or rollback.

Renvoie
FOFDatabaseDriverPostgresql Returns this object to support chaining.
Depuis
12.1
Exceptions
RuntimeException

◆ updateObject()

updateObject (   $table,
$object,
  $key,
  $nulls = false 
)

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

Paramètres
string$tableThe name of the database table to update.
object&$objectA reference to an object whose public properties match the table fields.
array$keyThe name of the primary key.
boolean$nullsTrue to update null fields or false to ignore them.
Renvoie
boolean True on success.
Depuis
12.1
Exceptions
RuntimeException

Références $columns, $fields, $key, et null.

Documentation des champs

◆ $concat_operator

$concat_operator = '||'
protected

◆ $dbMinimum

$dbMinimum = '8.3.18'
staticprotected

◆ $name

$name = 'postgresql'

◆ $nameQuote

$nameQuote = '"'
protected

◆ $nullDate

$nullDate = '1970-01-01 00:00:00'
protected

◆ $queryObject

$queryObject = null
protected

◆ $serverType

$serverType = 'postgresql'

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