|
eZ Publish
[trunk]
|
The eZPostgreSQLDB class provides PostgreSQL database functions. More...
Inheritance diagram for eZPostgreSQLDB:
Collaboration diagram for eZPostgreSQLDB:Public Member Functions | |
| arrayQuery ($sql, $params=array(), $server=false) | |
| Executes an SQL query and returns the result as an array of accociative arrays. | |
| availableDatabases () | |
| Returns an array of available databases in the database, null of none available, false if listing databases not supported by database. | |
| beginQuery () | |
| bindingType () | |
| Returns type of binding used in database plugin. | |
| bindVariable ($value, $fieldDef=false) | |
| Binds variable. | |
| close () | |
| Will close the database connection. | |
| commitQuery () | |
| concatString ($strings=array()) | |
| Returns a sql-expression(string) to concatenate strings. | |
| correctSequenceValues () | |
| createDatabase ($dbName) | |
| Create a new database. | |
| databaseName () | |
| Returns the name of driver, this is used to determine the name of the database type. | |
| databaseServerVersion () | |
| Returns the version of the database server or false if no version could be retrieved/. | |
| escapeString ($str) | |
| Will escape a string so it's ready to be inserted in the database. | |
| eZPostgreSQLDB ($parameters) | |
| eZTableList ($server=eZDBInterface::SERVER_MASTER) | |
| Returns the existing ez publish tables in database. | |
| isCharsetSupported ($charset) | |
| Returns true if the charset $charset is supported by the connected database. | |
| lastSerialID ($table=false, $column= 'id') | |
| Returns the last serial ID generated with an auto increment field. | |
| lock ($table) | |
| Locks one or several tables. | |
| md5 ($str) | |
| Returns a sql-expression(string) to generate a md5 sum of the string. | |
| query ($sql, $server=false) | |
| Execute a query on the global MySQL database link. | |
| relationCount ($relationType=eZDBInterface::RELATION_TABLE) | |
| Returns the number of relation objects in the database for the relation type $relationType. | |
| relationCounts ($relationMask) | |
| Returns the relation count for all relation types in the mask $relationMask. | |
| relationList ($relationType=eZDBInterface::RELATION_TABLE) | |
| Returns the relation names in the database as an array for the relation type $relationType. | |
| relationMatchRegexp ($relationType) | |
| Return A regexp (PCRE) that can be used to filter out certain relation elements. | |
| removeDatabase ($dbName) | |
| Removes a database. | |
| removeRelation ($relationName, $relationType) | |
| Tries to remove the relation type $relationType named $relationName. | |
| rollbackQuery () | |
| setError () | |
| Sets the error message and error message number. | |
| supportedRelationTypeMask () | |
| Returns a mask of the relation type it supports. | |
| supportedRelationTypes () | |
| Returns an array of the relation types. | |
| unlock () | |
| Releases table locks. | |
Static Public Member Functions | |
| static | connectString ($server=null, $port=null, $db=null, $user=null, $password=null) |
Private Member Functions | |
| relationKind ($relationType) | |
| subString ($string, $from, $len=null) | |
| Returns a sql-expression(string) to get substring. | |
The eZPostgreSQLDB class provides PostgreSQL database functions.
eZPostgreSQLDB implementes PostgreSQLDB specific database code.
Definition at line 20 of file ezpostgresqldb.php.
| eZPostgreSQLDB::arrayQuery | ( | $ | sql, |
| $ | params = array(), |
||
| $ | server = false |
||
| ) |
Executes an SQL query and returns the result as an array of accociative arrays.
Example: $db->arrayQuery( 'SELECT * FROM eztable', array( 'limit' => 10, 'offset' => 5 ) );
| string | $sql | SQL query to execute. |
| array | $params | Associative array containing extra parameters, can contain:
|
| int | bool | $server | Which server to execute the query on, either eZDBInterface::SERVER_MASTER or eZDBInterface::SERVER_SLAVE |
Reimplemented from eZDBInterface.
Definition at line 241 of file ezpostgresqldb.php.
Referenced by correctSequenceValues(), eZTableList(), relationCount(), relationCounts(), and relationList().
Returns an array of available databases in the database, null of none available, false if listing databases not supported by database.
Reimplemented from eZDBInterface.
Definition at line 153 of file ezpostgresqldb.php.
The query to start the transaction.
Reimplemented from eZDBInterface.
Definition at line 537 of file ezpostgresqldb.php.
Returns type of binding used in database plugin.
Reimplemented from eZDBInterface.
Definition at line 178 of file ezpostgresqldb.php.
| eZPostgreSQLDB::bindVariable | ( | $ | value, |
| $ | fieldDef = false |
||
| ) |
Binds variable.
| mixed | $value | |
| mixed | $fieldDef |
Reimplemented from eZDBInterface.
Definition at line 183 of file ezpostgresqldb.php.
Will close the database connection.
Reimplemented from eZDBInterface.
Definition at line 613 of file ezpostgresqldb.php.
The query to commit the transaction.
Reimplemented from eZDBInterface.
Definition at line 545 of file ezpostgresqldb.php.
| eZPostgreSQLDB::concatString | ( | $ | strings = array() | ) |
Returns a sql-expression(string) to concatenate strings.
| array | $strings |
Reimplemented from eZDBInterface.
Definition at line 332 of file ezpostgresqldb.php.
| static eZPostgreSQLDB::connectString | ( | $ | server = null, |
| $ | port = null, |
||
| $ | db = null, |
||
| $ | user = null, |
||
| $ | password = null |
||
| ) | [static] |
Definition at line 136 of file ezpostgresqldb.php.
Referenced by eZPostgreSQLDB().
Sets PostgreSQL sequence values to the maximum values used in the corresponding columns.
Definition at line 668 of file ezpostgresqldb.php.
| eZPostgreSQLDB::createDatabase | ( | $ | dbName | ) |
Create a new database.
| string | $dbName |
Reimplemented from eZDBInterface.
Definition at line 618 of file ezpostgresqldb.php.
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'.
Reimplemented from eZDBInterface.
Definition at line 173 of file ezpostgresqldb.php.
Returns the version of the database server or false if no version could be retrieved/.
Reimplemented from eZDBInterface.
Definition at line 641 of file ezpostgresqldb.php.
| eZPostgreSQLDB::escapeString | ( | $ | str | ) |
Will escape a string so it's ready to be inserted in the database.
| string | $str |
Reimplemented from eZDBInterface.
Definition at line 606 of file ezpostgresqldb.php.
| eZPostgreSQLDB::eZPostgreSQLDB | ( | $ | parameters | ) |
Creates a new eZPostgreSQLDB object and connects to the database.
Definition at line 25 of file ezpostgresqldb.php.
| eZPostgreSQLDB::eZTableList | ( | $ | server = eZDBInterface::SERVER_MASTER | ) |
Returns the existing ez publish tables in database.
| int | $server |
Reimplemented from eZDBInterface.
Definition at line 464 of file ezpostgresqldb.php.
| eZPostgreSQLDB::isCharsetSupported | ( | $ | charset | ) |
Returns true if the charset $charset is supported by the connected database.
| string | $charset |
Reimplemented from eZDBInterface.
Definition at line 636 of file ezpostgresqldb.php.
| eZPostgreSQLDB::lastSerialID | ( | $ | table = false, |
| $ | column = 'id' |
||
| ) |
Returns the last serial ID generated with an auto increment field.
In this case that means the current value of the sequence assigned $table
| string | $table | |
| string | $column |
Reimplemented from eZDBInterface.
Definition at line 568 of file ezpostgresqldb.php.
| eZPostgreSQLDB::lock | ( | $ | table | ) |
Locks one or several tables.
| string | array | $table |
Reimplemented from eZDBInterface.
Definition at line 503 of file ezpostgresqldb.php.
| eZPostgreSQLDB::md5 | ( | $ | str | ) |
Returns a sql-expression(string) to generate a md5 sum of the string.
| string | $str |
Reimplemented from eZDBInterface.
Definition at line 338 of file ezpostgresqldb.php.
| eZPostgreSQLDB::query | ( | $ | sql, |
| $ | server = false |
||
| ) |
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.
| string | $sql | SQL query to execute. |
| int | bool | $server |
Reimplemented from eZDBInterface.
Definition at line 188 of file ezpostgresqldb.php.
Referenced by arrayQuery(), availableDatabases(), beginQuery(), commitQuery(), correctSequenceValues(), createDatabase(), lock(), removeDatabase(), and removeRelation().
| eZPostgreSQLDB::relationCount | ( | $ | relationType = eZDBInterface::RELATION_TABLE | ) |
Returns the number of relation objects in the database for the relation type $relationType.
| int | $relationType |
Reimplemented from eZDBInterface.
Definition at line 416 of file ezpostgresqldb.php.
| eZPostgreSQLDB::relationCounts | ( | $ | relationMask | ) |
Returns the relation count for all relation types in the mask $relationMask.
| int | $relationMask |
Reimplemented from eZDBInterface.
Definition at line 376 of file ezpostgresqldb.php.
| eZPostgreSQLDB::relationKind | ( | $ | relationType | ) | [private] |
Definition at line 364 of file ezpostgresqldb.php.
Referenced by eZTableList(), relationCount(), relationCounts(), and relationList().
| eZPostgreSQLDB::relationList | ( | $ | relationType = eZDBInterface::RELATION_TABLE | ) |
Returns the relation names in the database as an array for the relation type $relationType.
| int | $relationType |
Reimplemented from eZDBInterface.
Definition at line 440 of file ezpostgresqldb.php.
| eZPostgreSQLDB::relationMatchRegexp | ( | $ | relationType | ) |
Return A regexp (PCRE) that can be used to filter out certain relation elements.
If no special regexp is provided it will return false.
An example, will only match tables that start with 'ez'. return "#^ez#";
This function is currently used by the eZDBTool class to remove relation elements of a specific kind (Most likely eZ Publish related elements).
| int | $relationType | The type which needs to be filtered, this allows one regexp per type. |
Reimplemented from eZDBInterface.
Definition at line 481 of file ezpostgresqldb.php.
| eZPostgreSQLDB::removeDatabase | ( | $ | dbName | ) |
Removes a database.
| string | $dbName |
Reimplemented from eZDBInterface.
Definition at line 627 of file ezpostgresqldb.php.
| eZPostgreSQLDB::removeRelation | ( | $ | relationName, |
| $ | relationType | ||
| ) |
Tries to remove the relation type $relationType named $relationName.
| string | $relationName | |
| int | $relationType |
Reimplemented from eZDBInterface.
Definition at line 486 of file ezpostgresqldb.php.
The query to cancel the transaction.
Reimplemented from eZDBInterface.
Definition at line 553 of file ezpostgresqldb.php.
Sets the error message and error message number.
Reimplemented from eZDBInterface.
Definition at line 588 of file ezpostgresqldb.php.
Referenced by createDatabase(), eZPostgreSQLDB(), query(), and removeDatabase().
| eZPostgreSQLDB::subString | ( | $ | string, |
| $ | from, | ||
| $ | len = null |
||
| ) | [private] |
Returns a sql-expression(string) to get substring.
| string | $string | |
| int | $from | |
| int | $len |
Reimplemented from eZDBInterface.
Definition at line 320 of file ezpostgresqldb.php.
Returns a mask of the relation type it supports.
Reimplemented from eZDBInterface.
Definition at line 343 of file ezpostgresqldb.php.
Returns an array of the relation types.
Reimplemented from eZDBInterface.
Definition at line 352 of file ezpostgresqldb.php.
Referenced by relationCounts().
Releases table locks.
Reimplemented from eZDBInterface.
Definition at line 529 of file ezpostgresqldb.php.