eZ Publish  [4.2]
eZPostgreSQLDB Class Reference

The eZPostgreSQLDB class provides PostgreSQL database functions. More...

+ Inheritance diagram for eZPostgreSQLDB:
+ Collaboration diagram for eZPostgreSQLDB:

List of all members.

Public Member Functions

 arrayQuery ($sql, $params=array(), $server=false)
 availableDatabases ()
 beginQuery ()
 bindingType ()
 bindVariable ($value, $fieldDef=false)
 close ()
 commitQuery ()
 concatString ($strings=array())
 correctSequenceValues ()
 createDatabase ($dbName)
 databaseName ()
 databaseServerVersion ()
 escapeString ($str)
 eZPostgreSQLDB ($parameters)
 eZTableList ($server=eZDBInterface::SERVER_MASTER)
 isCharsetSupported ($charset)
 lastSerialID ($table=false, $column= 'id')
 Returns the last serial ID generated with an auto increment field.
 lock ($table)
 md5 ($str)
 query ($sql, $server=false)
 relationCount ($relationType=eZDBInterface::RELATION_TABLE)
 relationCounts ($relationMask)
 relationList ($relationType=eZDBInterface::RELATION_TABLE)
 relationMatchRegexp ($relationType)
 removeDatabase ($dbName)
 removeRelation ($relationName, $relationType)
 rollbackQuery ()
 setError ()
 supportedRelationTypeMask ()
 supportedRelationTypes ()
 unlock ()

Private Member Functions

 relationKind ($relationType)
 subString ($string, $from, $len=null)

Detailed Description

The eZPostgreSQLDB class provides PostgreSQL database functions.

eZPostgreSQLDB implementes PostgreSQLDB specific database code.

See also:
eZDB

Definition at line 42 of file ezpostgresqldb.php.


Member Function Documentation

eZPostgreSQLDB::arrayQuery ( sql,
params = array(),
server = false 
) [virtual]

Executes an SQL query and returns the result as an array of accociative arrays.

Parameters:
$sqlSQL query to execute.
$paramsAssociative array containing extra parameters, can contain:
  • offset - The offset of the query.
  • limit - The limit of the query.
  • column - Limit returned row arrays to only contain this column.
$serverWhich server to execute the query on, either eZDBInterface::SERVER_MASTER or eZDBInterface::SERVER_SLAVE

An example would be:

      $db->arrayQuery( 'SELECT * FROM eztable', array( 'limit' => 10, 'offset' => 5 ) );

Implements eZDBInterface.

Definition at line 202 of file ezpostgresqldb.php.

Referenced by correctSequenceValues(), eZTableList(), relationCount(), relationCounts(), and relationList().

eZPostgreSQLDB::availableDatabases ( )

Return alvailable databases in database.

Returns:
array of available databases, null of none available false if listing databases not supported by database

Reimplemented from eZDBInterface.

Definition at line 130 of file ezpostgresqldb.php.

eZPostgreSQLDB::beginQuery ( )

The query to start the transaction.

Reimplemented from eZDBInterface.

Definition at line 491 of file ezpostgresqldb.php.

eZPostgreSQLDB::bindingType ( ) [virtual]

Returns type of binding used in database plugin.

Implements eZDBInterface.

Definition at line 155 of file ezpostgresqldb.php.

eZPostgreSQLDB::bindVariable ( value,
fieldDef = false 
) [virtual]

Binds variable.

Implements eZDBInterface.

Definition at line 160 of file ezpostgresqldb.php.

eZPostgreSQLDB::close ( ) [virtual]

Will close the database connection.

Implements eZDBInterface.

Definition at line 567 of file ezpostgresqldb.php.

eZPostgreSQLDB::commitQuery ( )

The query to commit the transaction.

Reimplemented from eZDBInterface.

Definition at line 499 of file ezpostgresqldb.php.

eZPostgreSQLDB::concatString ( strings = array()) [virtual]
Returns:
a sql-expression(string) to concatenate strings.

Implements eZDBInterface.

Definition at line 286 of file ezpostgresqldb.php.

eZPostgreSQLDB::correctSequenceValues ( )

Sets PostgreSQL sequence values to the maximum values used in the corresponding columns.

Definition at line 622 of file ezpostgresqldb.php.

eZPostgreSQLDB::createDatabase ( dbName) [virtual]

Create a new database

Implements eZDBInterface.

Definition at line 572 of file ezpostgresqldb.php.

eZPostgreSQLDB::databaseName ( ) [virtual]

Returns the name of driver, this is used to determine the name of the database type. For instance multiple implementations of the MySQL database will all return 'mysql'.

Implements eZDBInterface.

Definition at line 150 of file ezpostgresqldb.php.

eZPostgreSQLDB::databaseServerVersion ( )
Returns:
the version of the database server or false if no version could be retrieved/

Reimplemented from eZDBInterface.

Definition at line 595 of file ezpostgresqldb.php.

eZPostgreSQLDB::escapeString ( str) [virtual]

Will escape a string so it's ready to be inserted in the database.

Implements eZDBInterface.

Definition at line 560 of file ezpostgresqldb.php.

eZPostgreSQLDB::eZPostgreSQLDB ( parameters)

Creates a new eZPostgreSQLDB object and connects to the database.

Definition at line 47 of file ezpostgresqldb.php.

eZPostgreSQLDB::eZTableList ( server = eZDBInterface::SERVER_MASTER) [virtual]
Returns:
existing ez publish tables in database

Implements eZDBInterface.

Definition at line 418 of file ezpostgresqldb.php.

eZPostgreSQLDB::isCharsetSupported ( charset)
Returns:
true if the charset $charset is supported by the connected database.

Reimplemented from eZDBInterface.

Definition at line 590 of file ezpostgresqldb.php.

eZPostgreSQLDB::lastSerialID ( table = false,
column = 'id' 
) [virtual]

Returns the last serial ID generated with an auto increment field.

In this case that means the current value of the sequence assigned $table

Parameters:
string$table
string$column
Returns:
int The most recent value for the sequence

Implements eZDBInterface.

Definition at line 522 of file ezpostgresqldb.php.

eZPostgreSQLDB::lock ( table) [virtual]

Locks a table

Implements eZDBInterface.

Definition at line 457 of file ezpostgresqldb.php.

eZPostgreSQLDB::md5 ( str) [virtual]
Returns:
a sql-expression(string) to generate a md5 sum of the string.

Implements eZDBInterface.

Definition at line 292 of file ezpostgresqldb.php.

eZPostgreSQLDB::query ( sql,
server = false 
) [virtual]

Execute a query on the global MySQL database link. If it returns an error, the script is halted and the attempted SQL query and MySQL error message are printed.

Parameters:
$sqlSQL query to execute.

Implements eZDBInterface.

Definition at line 165 of file ezpostgresqldb.php.

Referenced by arrayQuery(), availableDatabases(), beginQuery(), commitQuery(), correctSequenceValues(), createDatabase(), lock(), removeDatabase(), removeRelation(), and rollbackQuery().

eZPostgreSQLDB::relationCount ( relationType = eZDBInterface::RELATION_TABLE) [virtual]
Returns:
the number of relation objects in the database for the relation type $relationType.

Implements eZDBInterface.

Definition at line 370 of file ezpostgresqldb.php.

eZPostgreSQLDB::relationCounts ( relationMask) [virtual]
Returns:
the relation count for all relation types in the mask $relationMask.

Implements eZDBInterface.

Definition at line 330 of file ezpostgresqldb.php.

eZPostgreSQLDB::relationKind ( relationType) [private]

Definition at line 318 of file ezpostgresqldb.php.

Referenced by eZTableList(), relationCount(), relationCounts(), and relationList().

eZPostgreSQLDB::relationList ( relationType = eZDBInterface::RELATION_TABLE) [virtual]
Returns:
the relation names in the database as an array for the relation type $relationType.

Implements eZDBInterface.

Definition at line 394 of file ezpostgresqldb.php.

eZPostgreSQLDB::relationMatchRegexp ( relationType) [virtual]
Returns:
A regexp (PCRE) that can be used to filter out certain relation elements. If no special regexp is provided it will return false.
Parameters:
$relationTypeThe type which needs to be filtered, this allows one regexp per type.

An example, will only match tables that start with 'ez'.

     return "#^ez#";
Note:
This function is currently used by the eZDBTool class to remove relation elements of a specific kind (Most likely eZ Publish related elements).

Implements eZDBInterface.

Definition at line 435 of file ezpostgresqldb.php.

eZPostgreSQLDB::removeDatabase ( dbName) [virtual]

Removes a database

Implements eZDBInterface.

Definition at line 581 of file ezpostgresqldb.php.

eZPostgreSQLDB::removeRelation ( relationName,
relationType 
) [virtual]

Tries to remove the relation type $relationType named $relationName

Returns:
true if successful

Implements eZDBInterface.

Definition at line 440 of file ezpostgresqldb.php.

eZPostgreSQLDB::rollbackQuery ( )

The query to cancel the transaction.

Reimplemented from eZDBInterface.

Definition at line 507 of file ezpostgresqldb.php.

eZPostgreSQLDB::setError ( ) [virtual]

Sets the error message and error message number

Implements eZDBInterface.

Definition at line 542 of file ezpostgresqldb.php.

Referenced by createDatabase(), query(), and removeDatabase().

eZPostgreSQLDB::subString ( string,
from,
len = null 
) [private, virtual]
Returns:
a sql-expression(string) to get substring.

Implements eZDBInterface.

Definition at line 274 of file ezpostgresqldb.php.

eZPostgreSQLDB::supportedRelationTypeMask ( ) [virtual]
Returns:
a mask of the relation type it supports.

Implements eZDBInterface.

Definition at line 297 of file ezpostgresqldb.php.

eZPostgreSQLDB::supportedRelationTypes ( ) [virtual]
Returns:
an array of the relation types.

Implements eZDBInterface.

Definition at line 306 of file ezpostgresqldb.php.

Referenced by relationCounts().

eZPostgreSQLDB::unlock ( ) [virtual]

Releases table locks.

Implements eZDBInterface.

Definition at line 483 of file ezpostgresqldb.php.


The documentation for this class was generated from the following file: