|
eZ Publish
[trunk]
|
Inheritance diagram for eZDBInterface:Public Member Functions | |
| arrayQuery ($sql, $params=array(), $server=false) | |
| Executes an SQL query and returns the result as an array of accociative arrays. | |
| attribute ($name) | |
| Returns the value of the attribute $name if it exists, otherwise null. | |
| attributes () | |
| Returns the available attributes for this database handler. | |
| availableDatabases () | |
| Returns an array of available databases in the database, null of none available, false if listing databases not supported by database. | |
| begin () | |
| Begin a new transaction. | |
| beginQuery () | |
| The query to start a transaction. | |
| bindingType () | |
| Returns type of binding used in database plugin. | |
| bindVariable ($value, $fieldDef=false) | |
| Binds variable. | |
| bitAnd ($arg1, $arg2) | |
| Returns a sql-expression(string) to generate a bit and of the argument. | |
| bitOr ($arg1, $arg2) | |
| Returns a sql-expression(string) to generate a bit and of the argument. | |
| charset () | |
| Returns the charset which the database is encoded in. | |
| checkCharset ($charset, &$currentCharset) | |
| Checks if the requested character set matches the one used in the database. | |
| close () | |
| Will close the database connection. | |
| commit () | |
| Commits the current transaction. | |
| commitQuery () | |
| The query to commit the transaction. | |
| concatString ($strings=array()) | |
| Returns a sql-expression(string) to concatenate strings. | |
| connectRetryCount () | |
| Returns the number of times the db handler should try to reconnect if it fails. | |
| connectRetryWaitTime () | |
| Returns the number of seconds the db handler should wait before rereconnecting. | |
| createDatabase ($dbName) | |
| Create a new database. | |
| createTempTable ($createTableQuery= '', $server=self::SERVER_SLAVE) | |
| Create a new temporary table. | |
| databaseClientVersion () | |
| Returns the version of the database client or false if no version could be retrieved/. | |
| 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/. | |
| dropTempTable ($dropTableQuery= '', $server=self::SERVER_SLAVE) | |
| Drop temporary table. | |
| dropTempTableList ($tableList, $server=self::SERVER_SLAVE) | |
| Drop temporary table list. | |
| endTime () | |
| Returns the micro time when the timer was ended or false if no timer. | |
| endTimer () | |
| Stops the current timer and calculates the time taken. | |
| errorMessage () | |
| Returns the error message. | |
| errorNumber () | |
| Returns the error number. | |
| escapeString ($str) | |
| Will escape a string so it's ready to be inserted in the database. | |
| eZDBInterface ($parameters) | |
| Creates a new eZDBInterface object and connects to the database backend. | |
| eZTableList ($server=self::SERVER_MASTER) | |
| Returns the existing ez publish tables in database. | |
| generateFailedTransactionStack () | |
| Goes through the transaction stack tree {. | |
| generateFailedTransactionStackEntry ($stack, $indentCount) | |
| Recursive helper function for generating stack tree output. | |
| generateSQLINStatement ($elements, $columnName= '', $not=false, $unique=true, $type=false) | |
| This function can be used to create a SQL IN statement to be used in a WHERE clause: | |
| generateTraceEntry ($entry) | |
| Helper function for generating output for one stack-trace entry. | |
| generateUniqueTempTableName ($pattern, $randomizeIndex=false, $server=self::SERVER_SLAVE) | |
| Generate unique table name basing on the given pattern. | |
| hasAttribute ($name) | |
| Returns true if the attribute $name exists for this database handler. | |
| hasRequiredServerVersion ($minVersion, $name=false) | |
| Checks if the version number of the server is equal or larger than $minVersion. | |
| implodeWithTypeCast ($glue, &$pieces, $type) | |
| Casts elements of $pieces to type $type and returns them as string separated by $glue. | |
| insertFile ($path, $sqlFile, $usePathType=true) | |
| Inserts the SQL file $sqlFile found in the path $path into the currently connected database. | |
| invalidateTransaction () | |
| Invalidates the current transaction, see {. | |
| isCharsetSupported ($charset) | |
| Returns true if the charset $charset is supported by the connected database. | |
| isConnected () | |
| Returns true if we're connected to the database backend. | |
| isTransactionValid () | |
| Returns if the current or last running transaction is valid. | |
| lastSerialID ($table=false, $column=false) | |
| 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. | |
| prepareSqlQuery (&$fd, &$buffer) | |
| Prepare the sql file so we can create the database. | |
| 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. | |
| relationName ($relationType) | |
| Returns the name of the relation type which is usable in SQL or false if unknown type. | |
| removeDatabase ($dbName) | |
| Removes a database. | |
| removeRelation ($relationName, $relationType) | |
| Tries to remove the relation type $relationType named $relationName. | |
| reportError () | |
| This is called whenever an error occurs in one of the database handlers. | |
| reportQuery ($class, $sql, $numRows, $timeTaken, $asDebug=false) | |
| Writes a debug notice with query information. | |
| rollback () | |
| Cancels the transaction. | |
| rollbackQuery () | |
| The query to cancel the transaction. | |
| setError () | |
| Sets the error message and error message number. | |
| setErrorHandling ($errorHandling) | |
| Sets the eZDB error handling mode. | |
| setIsSQLOutputEnabled ($enabled) | |
| Enabled or disables sql output. | |
| socketPath () | |
| Returns the socket path for the database or false if no socket path was defined. | |
| startTime () | |
| Returns the micro time when the timer was start or false if no timer. | |
| startTimer () | |
| Records the current micro time. | |
| subString ($string, $from, $len=null) | |
| Returns a sql-expression(string) to get substring. | |
| supportedRelationTypeMask () | |
| Returns a mask of the relation type it supports. | |
| supportedRelationTypes () | |
| Returns an array of the relation types. | |
| supportsDefaultValuesInsertion () | |
| Returns true if the database handler support the insertion of default values, false if not. | |
| timeTaken () | |
| Returns the number of milliseconds the last operation took or false if no value. | |
| transactionCounter () | |
| Returns the current transaction counter. | |
| unlock () | |
| Releases table locks. | |
| usesBuiltinEncoding () | |
| Returns true if the database handles encoding itself. | |
| useShortNames () | |
| Returns if the short column names should be used insted of default ones. | |
| version () | |
| Get database version number. | |
Public Attributes | |
| $Charset | |
| $ConnectRetries | |
| $DB | |
| $DBConnection | |
| $DBWriteConnection | |
| $EndTime | |
| $ErrorMessage | |
| $ErrorNumber = 0 | |
| $InputTextCodec | |
| $IsConnected = false | |
| $NumQueries = 0 | |
| $OutputSQL | |
| $OutputTextCodec | |
| $Password | |
| $Port | |
| $RecordError = true | |
| $Server | |
| $SlaveDB | |
| $SlavePassword | |
| $SlavePort | |
| $SlaveServer | |
| $SlaveUser | |
| $SocketPath | |
| $StartTime | |
| $TimeTaken | |
| $TransactionCounter | |
| $TransactionIsValid | |
| $TransactionStackTree | |
| $UseBuiltinEncoding | |
| $UsePersistentConnection = false | |
| $User | |
| $UseSlaveServer | |
| const | BINDING_NAME = 1 |
| const | BINDING_NO = 0 |
| const | BINDING_ORDERED = 2 |
| const | ERROR_MISSING_EXTENSION = 1 |
| const | RELATION_INDEX = 4 |
| const | RELATION_INDEX_BIT = 16 |
| const | RELATION_MASK = 31 |
| const | RELATION_NONE = 0 |
| const | RELATION_SEQUENCE = 1 |
| const | RELATION_SEQUENCE_BIT = 2 |
| const | RELATION_TABLE = 0 |
| const | RELATION_TABLE_BIT = 1 |
| const | RELATION_TRIGGER = 2 |
| const | RELATION_TRIGGER_BIT = 4 |
| const | RELATION_VIEW = 3 |
| const | RELATION_VIEW_BIT = 8 |
| const | SERVER_MASTER = 1 |
| const | SERVER_SLAVE = 2 |
Protected Attributes | |
| $errorHandling = eZDB::ERROR_HANDLING_STANDARD | |
Definition at line 19 of file ezdbinterface.php.
| eZDBInterface::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 in eZMySQLDB, eZMySQLiDB, eZPostgreSQLDB, and eZNullDB.
Definition at line 667 of file ezdbinterface.php.
| eZDBInterface::attribute | ( | $ | name | ) |
Returns the value of the attribute $name if it exists, otherwise null.
| string | $name |
Definition at line 192 of file ezdbinterface.php.
Returns the available attributes for this database handler.
Definition at line 166 of file ezdbinterface.php.
Returns an array of available databases in the database, null of none available, false if listing databases not supported by database.
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 1384 of file ezdbinterface.php.
Begin a new transaction.
If we are already in transaction then we omit this new transaction and its matching commit or rollback.
Reimplemented in eZNullDB.
Definition at line 696 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\lock().
The query to start a transaction.
This function must be reimplemented in the subclasses.
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 756 of file ezdbinterface.php.
Referenced by begin().
Returns type of binding used in database plugin.
Reimplemented in eZMySQLDB, eZPostgreSQLDB, and eZMySQLiDB.
Definition at line 624 of file ezdbinterface.php.
| eZDBInterface::bindVariable | ( | $ | value, |
| $ | fieldDef = false |
||
| ) |
Binds variable.
| mixed | $value | |
| mixed | $fieldDef |
Reimplemented in eZMySQLDB, eZPostgreSQLDB, and eZMySQLiDB.
Definition at line 635 of file ezdbinterface.php.
| eZDBInterface::bitAnd | ( | $ | arg1, |
| $ | arg2 | ||
| ) |
Returns a sql-expression(string) to generate a bit and of the argument.
| string | $arg1 | |
| string | $arg2 |
Reimplemented in eZMySQLDB, and eZMySQLiDB.
Definition at line 530 of file ezdbinterface.php.
| eZDBInterface::bitOr | ( | $ | arg1, |
| $ | arg2 | ||
| ) |
Returns a sql-expression(string) to generate a bit and of the argument.
| string | $arg1 | |
| string | $arg2 |
Reimplemented in eZMySQLDB, and eZMySQLiDB.
Definition at line 542 of file ezdbinterface.php.
Returns the charset which the database is encoded in.
Definition at line 602 of file ezdbinterface.php.
| eZDBInterface::checkCharset | ( | $ | charset, |
| &$ | currentCharset | ||
| ) |
Checks if the requested character set matches the one used in the database.
The default is to always return true, see the specific database handler for more information.
| string | array | $charset | |
| string | $currentCharset | The charset that the database uses, will only be set if the match fails. |
Reimplemented in eZMySQLDB, and eZMySQLiDB.
Definition at line 215 of file ezdbinterface.php.
Will close the database connection.
Reimplemented in eZMySQLDB, eZMySQLiDB, eZPostgreSQLDB, and eZNullDB.
Definition at line 1279 of file ezdbinterface.php.
Commits the current transaction.
If this is not the outermost it will not commit to the database immediately but instead decrease the transaction counter.
If the current transaction had any errors in it the transaction will be rollbacked instead of commited. This ensures that the database is in a valid state. Also the PHP execution will be stopped.
Reimplemented in eZNullDB.
Definition at line 771 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\unlock().
The query to commit the transaction.
This function must be reimplemented in the subclasses.
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 840 of file ezdbinterface.php.
Referenced by commit().
| eZDBInterface::concatString | ( | $ | strings = array() | ) |
Returns a sql-expression(string) to concatenate strings.
| array | $strings |
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 507 of file ezdbinterface.php.
Returns the number of times the db handler should try to reconnect if it fails.
Definition at line 444 of file ezdbinterface.php.
Referenced by eZMySQLDB\connect(), eZMySQLiDB\connect(), and eZPostgreSQLDB\eZPostgreSQLDB().
Returns the number of seconds the db handler should wait before rereconnecting.
Definition at line 454 of file ezdbinterface.php.
Referenced by eZMySQLDB\connect(), eZMySQLiDB\connect(), and eZPostgreSQLDB\eZPostgreSQLDB().
| eZDBInterface::createDatabase | ( | $ | dbName | ) |
Create a new database.
| string | $dbName |
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 1300 of file ezdbinterface.php.
| eZDBInterface::createTempTable | ( | $ | createTableQuery = '', |
| $ | server = self::SERVER_SLAVE |
||
| ) |
Create a new temporary table.
| string | $createTableQuery | |
| int | $server |
Definition at line 1320 of file ezdbinterface.php.
Returns the version of the database client or false if no version could be retrieved/.
Reimplemented in eZMySQLDB, and eZMySQLiDB.
Definition at line 581 of file ezdbinterface.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 in eZMySQLDB, eZPostgreSQLDB, eZMySQLiDB, and eZNullDB.
Definition at line 424 of file ezdbinterface.php.
Referenced by hasRequiredServerVersion(), and insertFile().
Returns the version of the database server or false if no version could be retrieved/.
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 572 of file ezdbinterface.php.
Referenced by hasRequiredServerVersion().
| eZDBInterface::dropTempTable | ( | $ | dropTableQuery = '', |
| $ | server = self::SERVER_SLAVE |
||
| ) |
Drop temporary table.
| string | $dropTableQuery | |
| int | $server |
Reimplemented in eZMySQLDB, and eZMySQLiDB.
Definition at line 1332 of file ezdbinterface.php.
Referenced by dropTempTableList().
| eZDBInterface::dropTempTableList | ( | $ | tableList, |
| $ | server = self::SERVER_SLAVE |
||
| ) |
Drop temporary table list.
| array | $tableList | |
| int | $server |
Definition at line 1343 of file ezdbinterface.php.
Returns the micro time when the timer was ended or false if no timer.
private
Definition at line 401 of file ezdbinterface.php.
Stops the current timer and calculates the time taken.
private
Definition at line 376 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\query(), eZMySQLiDB\query(), and eZMySQLDB\query().
Returns the error number.
Definition at line 1373 of file ezdbinterface.php.
Referenced by eZMySQLiDB\availableDatabases(), eZMySQLDB\availableDatabases(), and insertFile().
| eZDBInterface::escapeString | ( | $ | str | ) |
Will escape a string so it's ready to be inserted in the database.
| string | $str |
Reimplemented in eZMySQLDB, eZMySQLiDB, eZPostgreSQLDB, and eZNullDB.
Definition at line 1269 of file ezdbinterface.php.
| eZDBInterface::eZDBInterface | ( | $ | parameters | ) |
Creates a new eZDBInterface object and connects to the database backend.
| array | $parameters |
Definition at line 50 of file ezdbinterface.php.
Referenced by eZMySQLDB\eZMySQLDB(), eZMySQLiDB\eZMySQLiDB(), eZNullDB\eZNullDB(), and eZPostgreSQLDB\eZPostgreSQLDB().
| eZDBInterface::eZTableList | ( | $ | server = self::SERVER_MASTER | ) |
Returns the existing ez publish tables in database.
| int | $server |
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 1157 of file ezdbinterface.php.
Referenced by generateUniqueTempTableName().
Goes through the transaction stack tree {.
Definition at line 888 of file ezdbinterface.php.
| eZDBInterface::generateFailedTransactionStackEntry | ( | $ | stack, |
| $ | indentCount | ||
| ) |
Recursive helper function for generating stack tree output.
private
| array | $stack | |
| int | $indentCount |
Definition at line 905 of file ezdbinterface.php.
Referenced by generateFailedTransactionStack().
| eZDBInterface::generateSQLINStatement | ( | $ | elements, |
| $ | columnName = '', |
||
| $ | not = false, |
||
| $ | unique = true, |
||
| $ | type = false |
||
| ) |
This function can be used to create a SQL IN statement to be used in a WHERE clause:
WHERE columnName IN ( element1, element2, ... ) By default, the elements that can be submitted as an anonymous array (or an integer value in case of a single element) will just be imploded. Drivers for databases with a limitation of the elements within an IN statement have to reimplement this function. It is also possible to negate the "IN" to a "NOT IN" by using the last parameter of this function.
Usage:
$db =& eZDb::instance(); $db->generateSQLINStatement( array( 2, 5, 43, ) );
| int | array | $elements | Elements that should (not) be matched by the IN statment as an integer or anonymous array |
| string | $columnName | Column name of the database table the IN statement should be created for |
| bool | $not | Will generate a "NOT IN" ( if set to true ) statement instead of an "IN" ( if set to false , default ) |
| $unique | Wether or not to make the array unique. Not implemented in this class, but can be used by extending classes (oracle does use it) | |
| $type | The type to cast the array elements to |
Definition at line 1462 of file ezdbinterface.php.
| eZDBInterface::generateTraceEntry | ( | $ | entry | ) |
Helper function for generating output for one stack-trace entry.
private
| array | $entry |
Definition at line 954 of file ezdbinterface.php.
Referenced by generateFailedTransactionStackEntry().
| eZDBInterface::generateUniqueTempTableName | ( | $ | pattern, |
| $ | randomizeIndex = false, |
||
| $ | server = self::SERVER_SLAVE |
||
| ) |
Generate unique table name basing on the given pattern.
If the pattern contains a (%) character then the character is replaced with a part providing uniqueness (e.g. random number).
| string | $pattern | |
| bool | $randomizeIndex | |
| int | $server |
Definition at line 1405 of file ezdbinterface.php.
| eZDBInterface::hasAttribute | ( | $ | name | ) |
Returns true if the attribute $name exists for this database handler.
| string | $name |
Definition at line 177 of file ezdbinterface.php.
| eZDBInterface::hasRequiredServerVersion | ( | $ | minVersion, |
| $ | name = false |
||
| ) |
Checks if the version number of the server is equal or larger than $minVersion.
Will also check if the database type is correct if $name is set.
| string | $minVersion | A string denoting the min. required version. |
| string | bool | $name | The name of the database type it requires or false if it does not matter. |
Definition at line 556 of file ezdbinterface.php.
| eZDBInterface::implodeWithTypeCast | ( | $ | glue, |
| &$ | pieces, | ||
| $ | type | ||
| ) |
Casts elements of $pieces to type $type and returns them as string separated by $glue.
Use {
$this->implodeWithTypeCast( ',', $myArray, 'int' ); | string | $glue | The separator. |
| array | $pieces | The array containing the elements. |
| string | $type | The type to cast to. |
Definition at line 1238 of file ezdbinterface.php.
Referenced by generateSQLINStatement().
| eZDBInterface::insertFile | ( | $ | path, |
| $ | sqlFile, | ||
| $ | usePathType = true |
||
| ) |
Inserts the SQL file $sqlFile found in the path $path into the currently connected database.
| string | $path | |
| string | $sqlFile | |
| bool | $usePathType |
Definition at line 280 of file ezdbinterface.php.
Invalidates the current transaction, see {.
Definition at line 1012 of file ezdbinterface.php.
Referenced by reportError().
| eZDBInterface::isCharsetSupported | ( | $ | charset | ) |
Returns true if the charset $charset is supported by the connected database.
| string | $charset |
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 591 of file ezdbinterface.php.
Returns true if we're connected to the database backend.
protected
Definition at line 1289 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\arrayQuery(), begin(), commit(), eZPostgreSQLDB\correctSequenceValues(), eZPostgreSQLDB\databaseServerVersion(), eZPostgreSQLDB\eZTableList(), eZPostgreSQLDB\lastSerialID(), eZPostgreSQLDB\lock(), eZPostgreSQLDB\query(), eZPostgreSQLDB\relationCount(), eZPostgreSQLDB\relationCounts(), eZPostgreSQLDB\relationList(), eZPostgreSQLDB\removeRelation(), and rollback().
Returns if the current or last running transaction is valid.
Definition at line 1113 of file ezdbinterface.php.
| eZDBInterface::lastSerialID | ( | $ | table = false, |
| $ | column = false |
||
| ) |
Returns the last serial ID generated with an auto increment field.
| string | bool | $table | |
| string | bool | $column |
Reimplemented in eZMySQLDB, eZMySQLiDB, eZPostgreSQLDB, and eZNullDB.
Definition at line 1259 of file ezdbinterface.php.
| eZDBInterface::lock | ( | $ | table | ) |
Locks one or several tables.
| string | array | $table |
Reimplemented in eZMySQLDB, eZMySQLiDB, eZPostgreSQLDB, and eZNullDB.
Definition at line 676 of file ezdbinterface.php.
| eZDBInterface::md5 | ( | $ | str | ) |
Returns a sql-expression(string) to generate a md5 sum of the string.
| string | $str |
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 518 of file ezdbinterface.php.
Referenced by reportError().
| eZDBInterface::prepareSqlQuery | ( | &$ | fd, |
| &$ | buffer | ||
| ) |
Prepare the sql file so we can create the database.
private
| resource | $fd | The file descriptor |
| string | $buffer | Reference to string buffer for SQL queries. |
Definition at line 228 of file ezdbinterface.php.
Referenced by insertFile().
| eZDBInterface::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 in eZMySQLDB, eZMySQLiDB, eZPostgreSQLDB, and eZNullDB.
Definition at line 647 of file ezdbinterface.php.
Referenced by createTempTable(), dropTempTable(), and insertFile().
| eZDBInterface::relationCount | ( | $ | relationType = eZDBInterface::RELATION_TABLE | ) |
Returns the number of relation objects in the database for the relation type $relationType.
| int | $relationType |
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 1147 of file ezdbinterface.php.
| eZDBInterface::relationCounts | ( | $ | relationMask | ) |
Returns the relation count for all relation types in the mask $relationMask.
| int | $relationMask |
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 1137 of file ezdbinterface.php.
| eZDBInterface::relationList | ( | $ | relationType = eZDBInterface::RELATION_TABLE | ) |
Returns the relation names in the database as an array for the relation type $relationType.
| int | $relationType |
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 1167 of file ezdbinterface.php.
| eZDBInterface::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 in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 1219 of file ezdbinterface.php.
| eZDBInterface::relationName | ( | $ | relationType | ) |
Returns the name of the relation type which is usable in SQL or false if unknown type.
This function can be used by some database handlers which can operate on relation types using SQL.
protected
| int | $relationType |
Reimplemented in eZMySQLDB, and eZMySQLiDB.
Definition at line 1192 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\removeRelation().
| eZDBInterface::removeDatabase | ( | $ | dbName | ) |
Removes a database.
| string | $dbName |
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 1310 of file ezdbinterface.php.
| eZDBInterface::removeRelation | ( | $ | relationName, |
| $ | relationType | ||
| ) |
Tries to remove the relation type $relationType named $relationName.
| string | $relationName | |
| int | $relationType |
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 1178 of file ezdbinterface.php.
This is called whenever an error occurs in one of the database handlers.
If a transaction is active it will be invalidated as well.
protected
| eZDBException |
Definition at line 1028 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\query(), eZMySQLiDB\query(), and eZMySQLDB\query().
| eZDBInterface::reportQuery | ( | $ | class, |
| $ | sql, | ||
| $ | numRows, | ||
| $ | timeTaken, | ||
| $ | asDebug = false |
||
| ) |
Writes a debug notice with query information.
private
| string | $class | |
| string | $sql | |
| int | string | $numRows | |
| int | string | $timeTaken | |
| bool | $asDebug |
Definition at line 339 of file ezdbinterface.php.
Referenced by eZMySQLiDB\arrayQuery(), eZMySQLDB\arrayQuery(), eZMySQLiDB\checkCharsetPriv(), eZMySQLDB\checkCharsetPriv(), eZMySQLDB\connect(), eZMySQLiDB\eZTableList(), eZMySQLDB\eZTableList(), eZPostgreSQLDB\query(), eZMySQLiDB\query(), eZMySQLDB\query(), eZMySQLiDB\relationCount(), eZMySQLDB\relationCount(), eZMySQLiDB\relationList(), and eZMySQLDB\relationList().
Cancels the transaction.
Reimplemented in eZNullDB.
Definition at line 850 of file ezdbinterface.php.
Referenced by reportError().
The query to cancel the transaction.
This function must be reimplemented in the subclasses.
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 1001 of file ezdbinterface.php.
Referenced by commit(), and rollback().
Sets the error message and error message number.
Reimplemented in eZPostgreSQLDB.
Definition at line 1354 of file ezdbinterface.php.
Referenced by eZMySQLiDB\checkCharsetPriv(), eZMySQLDB\checkCharsetPriv(), eZMySQLDB\connect(), eZMySQLiDB\connect(), eZMySQLiDB\createDatabase(), eZMySQLDB\createDatabase(), eZMySQLiDB\query(), eZMySQLDB\query(), eZMySQLiDB\removeDatabase(), and eZMySQLDB\removeDatabase().
| eZDBInterface::setErrorHandling | ( | $ | errorHandling | ) |
Sets the eZDB error handling mode.
| int | $errorHandling | Possible values are:pm
|
Definition at line 1500 of file ezdbinterface.php.
| eZDBInterface::setIsSQLOutputEnabled | ( | $ | enabled | ) |
Enabled or disables sql output.
| bool | $enabled |
Definition at line 356 of file ezdbinterface.php.
Returns the socket path for the database or false if no socket path was defined.
Definition at line 434 of file ezdbinterface.php.
Returns the micro time when the timer was start or false if no timer.
private
Definition at line 390 of file ezdbinterface.php.
Records the current micro time.
End the timer with endTimer() and fetch the result with timeTaken();
private
Definition at line 366 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\query(), eZMySQLiDB\query(), and eZMySQLDB\query().
| eZDBInterface::subString | ( | $ | string, |
| $ | from, | ||
| $ | len = null |
||
| ) |
Returns a sql-expression(string) to get substring.
| string | $string | |
| int | $from | |
| int | $len |
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 496 of file ezdbinterface.php.
Returns a mask of the relation type it supports.
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 464 of file ezdbinterface.php.
Returns an array of the relation types.
Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.
Definition at line 483 of file ezdbinterface.php.
Returns true if the database handler support the insertion of default values, false if not.
Reimplemented in eZMySQLDB, and eZMySQLiDB.
Definition at line 1487 of file ezdbinterface.php.
Returns the number of milliseconds the last operation took or false if no value.
private
Definition at line 412 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\query(), eZMySQLiDB\query(), and eZMySQLDB\query().
Returns the current transaction counter.
0 means no transactions, 1 or higher means 1 or more transactions are running and a negative value means something is wrong.
Definition at line 1126 of file ezdbinterface.php.
Releases table locks.
Reimplemented in eZMySQLDB, eZMySQLiDB, eZPostgreSQLDB, and eZNullDB.
Definition at line 685 of file ezdbinterface.php.
Returns true if the database handles encoding itself.
If not, all queries and returned data must be decoded yourselves.
This functionality might be removed in the future
Definition at line 614 of file ezdbinterface.php.
Returns if the short column names should be used insted of default ones.
Definition at line 474 of file ezdbinterface.php.
Get database version number.
Definition at line 1426 of file ezdbinterface.php.
| eZDBInterface::$Charset |
Definition at line 1579 of file ezdbinterface.php.
| eZDBInterface::$ConnectRetries |
Definition at line 1587 of file ezdbinterface.php.
| eZDBInterface::$DB |
Definition at line 1539 of file ezdbinterface.php.
| eZDBInterface::$DBConnection |
Definition at line 1547 of file ezdbinterface.php.
| eZDBInterface::$DBWriteConnection |
Definition at line 1555 of file ezdbinterface.php.
| eZDBInterface::$EndTime |
Definition at line 1651 of file ezdbinterface.php.
eZDBInterface::$errorHandling = eZDB::ERROR_HANDLING_STANDARD [protected] |
Definition at line 1770 of file ezdbinterface.php.
Referenced by setErrorHandling().
| eZDBInterface::$ErrorMessage |
Definition at line 1667 of file ezdbinterface.php.
| eZDBInterface::$ErrorNumber = 0 |
Definition at line 1675 of file ezdbinterface.php.
| eZDBInterface::$InputTextCodec |
Definition at line 1603 of file ezdbinterface.php.
| eZDBInterface::$IsConnected = false |
Definition at line 1627 of file ezdbinterface.php.
| eZDBInterface::$NumQueries = 0 |
Definition at line 1635 of file ezdbinterface.php.
| eZDBInterface::$OutputSQL |
Definition at line 1619 of file ezdbinterface.php.
| eZDBInterface::$OutputTextCodec |
Definition at line 1595 of file ezdbinterface.php.
| eZDBInterface::$Password |
Definition at line 1571 of file ezdbinterface.php.
| eZDBInterface::$Port |
Definition at line 1523 of file ezdbinterface.php.
| eZDBInterface::$RecordError = true |
Definition at line 1683 of file ezdbinterface.php.
| eZDBInterface::$Server |
Definition at line 1515 of file ezdbinterface.php.
| eZDBInterface::$SlaveDB |
Definition at line 1707 of file ezdbinterface.php.
| eZDBInterface::$SlavePassword |
Definition at line 1739 of file ezdbinterface.php.
| eZDBInterface::$SlavePort |
Definition at line 1723 of file ezdbinterface.php.
| eZDBInterface::$SlaveServer |
Definition at line 1715 of file ezdbinterface.php.
| eZDBInterface::$SlaveUser |
Definition at line 1731 of file ezdbinterface.php.
| eZDBInterface::$SocketPath |
Definition at line 1531 of file ezdbinterface.php.
| eZDBInterface::$StartTime |
Definition at line 1643 of file ezdbinterface.php.
| eZDBInterface::$TimeTaken |
Definition at line 1659 of file ezdbinterface.php.
| eZDBInterface::$TransactionCounter |
Definition at line 1747 of file ezdbinterface.php.
| eZDBInterface::$TransactionIsValid |
Definition at line 1755 of file ezdbinterface.php.
| eZDBInterface::$TransactionStackTree |
Definition at line 1763 of file ezdbinterface.php.
| eZDBInterface::$UseBuiltinEncoding |
Definition at line 1611 of file ezdbinterface.php.
| eZDBInterface::$UsePersistentConnection = false |
Definition at line 1691 of file ezdbinterface.php.
| eZDBInterface::$User |
Definition at line 1563 of file ezdbinterface.php.
| eZDBInterface::$UseSlaveServer |
Definition at line 1699 of file ezdbinterface.php.
| const eZDBInterface::BINDING_NAME = 1 |
Definition at line 22 of file ezdbinterface.php.
| const eZDBInterface::BINDING_NO = 0 |
Definition at line 21 of file ezdbinterface.php.
Referenced by eZMySQLiDB\bindingType(), eZPostgreSQLDB\bindingType(), eZMySQLDB\bindingType(), eZPersistentObject\storeObject(), eZPersistentObject\updateObjectList(), and ezpSessionHandlerDB\write().
| const eZDBInterface::BINDING_ORDERED = 2 |
Definition at line 23 of file ezdbinterface.php.
| const eZDBInterface::ERROR_MISSING_EXTENSION = 1 |
Definition at line 40 of file ezdbinterface.php.
Referenced by eZMySQLDB\eZMySQLDB(), eZMySQLiDB\eZMySQLiDB(), and eZPostgreSQLDB\eZPostgreSQLDB().
| const eZDBInterface::RELATION_INDEX = 4 |
Definition at line 29 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\relationKind(), relationName(), and eZPostgreSQLDB\supportedRelationTypes().
| const eZDBInterface::RELATION_INDEX_BIT = 16 |
Definition at line 35 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\supportedRelationTypeMask().
| const eZDBInterface::RELATION_MASK = 31 |
Definition at line 38 of file ezdbinterface.php.
| const eZDBInterface::RELATION_NONE = 0 |
Definition at line 37 of file ezdbinterface.php.
Referenced by supportedRelationTypeMask().
| const eZDBInterface::RELATION_SEQUENCE = 1 |
Definition at line 26 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\eZTableList(), eZPostgreSQLDB\relationKind(), relationName(), and eZPostgreSQLDB\supportedRelationTypes().
| const eZDBInterface::RELATION_SEQUENCE_BIT = 2 |
Definition at line 32 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\supportedRelationTypeMask().
| const eZDBInterface::RELATION_TABLE = 0 |
Definition at line 25 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\eZTableList(), eZMySQLiDB\eZTableList(), eZMySQLDB\eZTableList(), eZMySQLiDB\relationCount(), eZMySQLDB\relationCount(), eZPostgreSQLDB\relationKind(), eZMySQLiDB\relationList(), eZMySQLDB\relationList(), relationName(), eZPostgreSQLDB\supportedRelationTypes(), eZMySQLiDB\supportedRelationTypes(), and eZMySQLDB\supportedRelationTypes().
| const eZDBInterface::RELATION_TABLE_BIT = 1 |
Definition at line 31 of file ezdbinterface.php.
Referenced by eZMySQLiDB\relationCounts(), eZMySQLDB\relationCounts(), eZPostgreSQLDB\supportedRelationTypeMask(), eZMySQLiDB\supportedRelationTypeMask(), and eZMySQLDB\supportedRelationTypeMask().
| const eZDBInterface::RELATION_TRIGGER = 2 |
Definition at line 27 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\relationKind(), relationName(), and eZPostgreSQLDB\supportedRelationTypes().
| const eZDBInterface::RELATION_TRIGGER_BIT = 4 |
Definition at line 33 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\supportedRelationTypeMask().
| const eZDBInterface::RELATION_VIEW = 3 |
Definition at line 28 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\relationKind(), relationName(), and eZPostgreSQLDB\supportedRelationTypes().
| const eZDBInterface::RELATION_VIEW_BIT = 8 |
Definition at line 34 of file ezdbinterface.php.
Referenced by eZPostgreSQLDB\supportedRelationTypeMask().
| const eZDBInterface::SERVER_MASTER = 1 |
Definition at line 42 of file ezdbinterface.php.
Referenced by eZMySQLiDB\query(), and eZMySQLDB\query().
| const eZDBInterface::SERVER_SLAVE = 2 |
Definition at line 43 of file ezdbinterface.php.
Referenced by eZSearchEngine\buildTempTablesForFullTextSearch(), eZContentObjectTreeNode\calendar(), eZContentObjectTreeNode\createPermissionCheckingSQL(), eZSearchEngine\createTemporaryTable(), eZMySQLiDB\eZTableList(), eZMySQLDB\eZTableList(), eZShopFunctionCollection\fetchRelatedPurchaseList(), eZMySQLiDB\query(), eZMySQLDB\query(), eZSearchEngine\search(), eZContentObjectTreeNode\subTreeByNodeID(), eZContentObjectTreeNode\subTreeCountByNodeID(), eZContentObjectTreeNode\subTreeMultiPaths(), and eZContentObjectTreeNode\subtreeSoleNodeCount().