eZ Publish  [trunk]
eZDBInterface Class Reference
+ Inheritance diagram for eZDBInterface:

List of all members.

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

Detailed Description

Definition at line 19 of file ezdbinterface.php.


Member Function Documentation

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 ) );

Parameters:
string$sqlSQL query to execute.
array$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.
int | bool$serverWhich server to execute the query on, either eZDBInterface::SERVER_MASTER or eZDBInterface::SERVER_SLAVE
Returns:
array

Reimplemented in eZMySQLDB, eZMySQLiDB, eZPostgreSQLDB, and eZNullDB.

Definition at line 667 of file ezdbinterface.php.

Returns the value of the attribute $name if it exists, otherwise null.

Parameters:
string$name
Returns:
null

Definition at line 192 of file ezdbinterface.php.

Returns the available attributes for this database handler.

Returns:
array

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.

Returns:
array|null|bool

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.

Returns:
bool

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.

Returns:
bool

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.

Returns:
int

Reimplemented in eZMySQLDB, eZPostgreSQLDB, and eZMySQLiDB.

Definition at line 624 of file ezdbinterface.php.

eZDBInterface::bindVariable ( value,
fieldDef = false 
)

Binds variable.

Parameters:
mixed$value
mixed$fieldDef
Returns:
mixed

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.

Parameters:
string$arg1
string$arg2
Returns:
string

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.

Parameters:
string$arg1
string$arg2
Returns:
string

Reimplemented in eZMySQLDB, and eZMySQLiDB.

Definition at line 542 of file ezdbinterface.php.

Returns the charset which the database is encoded in.

See also:
usesBuiltinEncoding()
Returns:
string

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.

Parameters:
string | array$charset
string$currentCharsetThe charset that the database uses, will only be set if the match fails.
Returns:
bool true if it matches or false if it differs.

Reimplemented in eZMySQLDB, and eZMySQLiDB.

Definition at line 215 of file ezdbinterface.php.

Will close the database connection.

Returns:
void

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.

Returns:
bool true if the transaction was successful, false otherwise.

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.

Returns:
bool

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.

Parameters:
array$strings
Returns:
string

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.

Returns:
int

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.

Returns:
int

Definition at line 454 of file ezdbinterface.php.

Referenced by eZMySQLDB\connect(), eZMySQLiDB\connect(), and eZPostgreSQLDB\eZPostgreSQLDB().

Create a new database.

Parameters:
string$dbName
Returns:
void

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.

Parameters:
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/.

Returns:
string|bool

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'.

Returns:
string

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/.

Returns:
string|bool

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.

Parameters:
string$dropTableQuery
int$server
Returns:
void

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.

Parameters:
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

Returns:
bool|float

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 message.

Returns:
string

Definition at line 1363 of file ezdbinterface.php.

Returns the error number.

Returns:
int

Definition at line 1373 of file ezdbinterface.php.

Referenced by eZMySQLiDB\availableDatabases(), eZMySQLDB\availableDatabases(), and insertFile().

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

Parameters:
string$str
Returns:
string mixed

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.

Parameters:
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.

Parameters:
int$server
Returns:
array

Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.

Definition at line 1157 of file ezdbinterface.php.

Referenced by generateUniqueTempTableName().

Goes through the transaction stack tree {.

See also:
eZDBInterface::$TransactionStackTree}, generates the text output for it and returns it.
Returns:
bool|string The generated string or false if it is disabled.

Definition at line 888 of file ezdbinterface.php.

eZDBInterface::generateFailedTransactionStackEntry ( stack,
indentCount 
)

Recursive helper function for generating stack tree output.

private

Parameters:
array$stack
int$indentCount
Returns:
string The generated string

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, ) );

Parameters:
int | array$elementsElements that should (not) be matched by the IN statment as an integer or anonymous array
string$columnNameColumn name of the database table the IN statement should be created for
bool$notWill generate a "NOT IN" ( if set to true ) statement instead of an "IN" ( if set to false , default )
$uniqueWether or not to make the array unique. Not implemented in this class, but can be used by extending classes (oracle does use it)
$typeThe type to cast the array elements to
Returns:
string A string with the correct IN statement like for example "columnName IN ( element1, element2 )"

Definition at line 1462 of file ezdbinterface.php.

Helper function for generating output for one stack-trace entry.

private

Parameters:
array$entry
Returns:
string The generated string

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).

Parameters:
string$pattern
bool$randomizeIndex
int$server
Returns:
string

Definition at line 1405 of file ezdbinterface.php.

Returns true if the attribute $name exists for this database handler.

Parameters:
string$name
Returns:
bool

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.

Parameters:
string$minVersionA string denoting the min. required version.
string | bool$nameThe name of the database type it requires or false if it does not matter.
Returns:
bool true if the server fulfills the requirements.

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 {

See also:
generateSQLINStatement()} if you intend to use this for IN statments! Example: $this->implodeWithTypeCast( ',', $myArray, 'int' );
Parameters:
string$glueThe separator.
array$piecesThe array containing the elements.
string$typeThe type to cast to.
Returns:
string

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.

Parameters:
string$path
string$sqlFile
bool$usePathType
Returns:
bool true if succesful.

Definition at line 280 of file ezdbinterface.php.

Invalidates the current transaction, see {.

See also:
commit()} for more details on this.
isTransactionValid()
Returns:
bool true if it was invalidated or false if there is no transaction to invalidate.

Definition at line 1012 of file ezdbinterface.php.

Referenced by reportError().

Returns true if the charset $charset is supported by the connected database.

Parameters:
string$charset
Returns:
bool

Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.

Definition at line 591 of file ezdbinterface.php.

Returns if the current or last running transaction is valid.

See also:
invalidateTransaction()
Returns:
bool true if the current or last running transaction was valid, false otherwise

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.

Parameters:
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.

Parameters:
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.

Parameters:
string$str
Returns:
string

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

Parameters:
resource$fdThe file descriptor
string$bufferReference to string buffer for SQL queries.
Returns:
array

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.

Parameters:
string$sqlSQL query to execute.
int | bool$server
Returns:
mixed

Reimplemented in eZMySQLDB, eZMySQLiDB, eZPostgreSQLDB, and eZNullDB.

Definition at line 647 of file ezdbinterface.php.

Referenced by createTempTable(), dropTempTable(), and insertFile().

Returns the number of relation objects in the database for the relation type $relationType.

Parameters:
int$relationType
Returns:
int

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.

Parameters:
int$relationMask
Returns:
int

Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.

Definition at line 1137 of file ezdbinterface.php.

Returns the relation names in the database as an array for the relation type $relationType.

Parameters:
int$relationType
Returns:
array

Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.

Definition at line 1167 of file ezdbinterface.php.

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).

Parameters:
int$relationTypeThe type which needs to be filtered, this allows one regexp per type.
Returns:
bool

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

Parameters:
int$relationType
Returns:
bool

Reimplemented in eZMySQLDB, and eZMySQLiDB.

Definition at line 1192 of file ezdbinterface.php.

Referenced by eZPostgreSQLDB\removeRelation().

Removes a database.

Parameters:
string$dbName
Returns:
void

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.

Parameters:
string$relationName
int$relationType
Returns:
bool true if successful

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

Exceptions:
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 
)

Cancels the transaction.

Returns:
bool

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.

Returns:
bool

Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.

Definition at line 1001 of file ezdbinterface.php.

Referenced by commit(), and rollback().

eZDBInterface::setErrorHandling ( errorHandling)

Sets the eZDB error handling mode.

Parameters:
int$errorHandlingPossible values are:pm
Since:
4.5

Definition at line 1500 of file ezdbinterface.php.

Enabled or disables sql output.

Parameters:
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.

Returns:
string|bool

Definition at line 434 of file ezdbinterface.php.

Returns the micro time when the timer was start or false if no timer.

private

Returns:
bool|float

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.

Parameters:
string$string
int$from
int$len
Returns:
string

Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.

Definition at line 496 of file ezdbinterface.php.

Returns a mask of the relation type it supports.

Returns:
int

Reimplemented in eZMySQLDB, eZMySQLiDB, and eZPostgreSQLDB.

Definition at line 464 of file ezdbinterface.php.

Returns an array of the relation types.

Returns:
array

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.

Returns:
bool

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

Returns:
bool|float

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.

Returns:
int

Definition at line 1126 of file ezdbinterface.php.

Releases table locks.

Returns:
void

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

Returns:
bool

Definition at line 614 of file ezdbinterface.php.

Returns if the short column names should be used insted of default ones.

Returns:
bool

Definition at line 474 of file ezdbinterface.php.

Get database version number.

Returns:
string|bool Version number, false if not supported

Definition at line 1426 of file ezdbinterface.php.


Member Data Documentation

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.

Definition at line 22 of file ezdbinterface.php.

Definition at line 23 of file ezdbinterface.php.

Definition at line 38 of file ezdbinterface.php.

Definition at line 37 of file ezdbinterface.php.

Referenced by supportedRelationTypeMask().

Definition at line 42 of file ezdbinterface.php.

Referenced by eZMySQLiDB\query(), and eZMySQLDB\query().


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