lib/ezdb/classes/ezdbinterface.php

Show: inherited
Table of Contents

File containing the eZDBInterface class.

Copyright
Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.  
License
eZ Business Use License Agreement Version 2.0  
Package
lib  
Version
4.6.0  

\eZDBInterface

Package: lib

File containing the eZDBInterface class.

Children
\eZMySQLDB
\eZMySQLiDB
\eZNullDB
\eZPostgreSQLDB
Copyright
Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.  
License
eZ Business Use License Agreement Version 2.0  
Version
4.6.0  

Constants

Constant  BINDING_NO = 0
Constant  BINDING_NAME = 1
Constant  BINDING_ORDERED = 2
Constant  RELATION_TABLE = 0
Constant  RELATION_SEQUENCE = 1
Constant  RELATION_TRIGGER = 2
Constant  RELATION_VIEW = 3
Constant  RELATION_INDEX = 4
Constant  RELATION_TABLE_BIT = 1
Constant  RELATION_SEQUENCE_BIT = 2
Constant  RELATION_TRIGGER_BIT = 4
Constant  RELATION_VIEW_BIT = 8
Constant  RELATION_INDEX_BIT = 16
Constant  RELATION_NONE = 0
Constant  RELATION_MASK = 31
Constant  ERROR_MISSING_EXTENSION = 1
Constant  SERVER_MASTER = 1
Constant  SERVER_SLAVE = 2

Properties

Propertypublic  $Charset= ''
Details
Type
n/a
Propertypublic  $ConnectRetries= ''
Details
Type
n/a
Propertypublic  $DB= ''
Details
Type
n/a
Propertypublic  $DBConnection= ''
Details
Type
n/a
Propertypublic  $DBWriteConnection= ''
Details
Type
n/a
Propertypublic  $EndTime= ''
Details
Type
n/a
Propertypublic  $ErrorMessage= ''
Details
Type
n/a
Propertypublic  $ErrorNumber= '0'
Default value0Details
Type
n/a
Propertypublic  $InputTextCodec= ''
Details
Type
n/a
Propertypublic  $IsConnected= 'false'
Default valuefalseDetails
Type
n/a
Propertypublic  $NumQueries= '0'
Default value0Details
Type
n/a
Propertypublic  $OutputSQL= ''
Details
Type
n/a
Propertypublic  $OutputTextCodec= ''
Details
Type
n/a
Propertypublic  $Password= ''
Details
Type
n/a
Propertypublic  $Port= ''
Details
Type
n/a
Propertypublic  $RecordError= 'true'
Default valuetrueDetails
Type
n/a
Propertypublic  $Server= ''
Details
Type
n/a
Propertypublic  $SlaveDB= ''
Details
Type
n/a
Propertypublic  $SlavePassword= ''
Details
Type
n/a
Propertypublic  $SlavePort= ''
Details
Type
n/a
Propertypublic  $SlaveServer= ''
Details
Type
n/a
Propertypublic  $SlaveUser= ''
Details
Type
n/a
Propertypublic  $SocketPath= ''
Details
Type
n/a
Propertypublic  $StartTime= ''
Details
Type
n/a
Propertypublic  $TimeTaken= ''
Details
Type
n/a
Propertypublic  $TransactionCounter= ''
Details
Type
n/a
Propertypublic  $TransactionIsValid= ''
Details
Type
n/a
Propertypublic  $UseBuiltinEncoding= ''
Details
Type
n/a
Propertypublic  $UsePersistentConnection= 'false'
Default valuefalseDetails
Type
n/a
Propertypublic  $UseSlaveServer= ''
Details
Type
n/a
Propertypublic  $User= ''
Details
Type
n/a
Propertyprotectedint  $errorHandling= 'eZDB::ERROR_HANDLING_STANDARD'

Error handling mechanism

One of the eZDB::ERROR_HANDLING_* constants
Default valueeZDB::ERROR_HANDLING_STANDARDDetails
Type
int

Methods

methodpublicarrayQuery(  $sql,  $params = array(),  $server = false ) : void

Parameters
Name Type Description
$sql
$params
$server
methodpublicattribute(  $name ) : void

Parameters
Name Type Description
$name
methodpublicattributes( ) : void

methodpublicavailableDatabases( ) : void

methodpublicbegin( ) : void

methodpublicbeginQuery( ) : void

methodpublicbindVariable(  $value,  $fieldDef = false ) : void

Parameters
Name Type Description
$value
$fieldDef
methodpublicbindingType( ) : void

methodpublicbitAnd(  $arg1,  $arg2 ) : void

Parameters
Name Type Description
$arg1
$arg2
methodpublicbitOr(  $arg1,  $arg2 ) : void

Parameters
Name Type Description
$arg1
$arg2
methodpubliccharset( ) : void

methodpubliccheckCharset(  $charset,  $currentCharset ) : void

Parameters
Name Type Description
$charset
$currentCharset
methodpublicclose( ) : void

methodpubliccommit( ) : void

methodpubliccommitQuery( ) : void

methodpublicconcatString(  $strings = array() ) : void

Parameters
Name Type Description
$strings
methodpublicconnectRetryCount( ) : void

methodpublicconnectRetryWaitTime( ) : void

methodpubliccreateDatabase(  $dbName ) : void

Parameters
Name Type Description
$dbName
methodpubliccreateTempTable(  $createTableQuery = '',  $server = self::SERVER_SLAVE ) : void

Parameters
Name Type Description
$createTableQuery
$server
methodpublicdatabaseClientVersion( ) : void

methodpublicdatabaseName( ) : void

methodpublicdatabaseServerVersion( ) : void

methodpublicdropTempTable(  $dropTableQuery = '',  $server = self::SERVER_SLAVE ) : void

Parameters
Name Type Description
$dropTableQuery
$server
methodpublicdropTempTableList(  $tableList,  $server = self::SERVER_SLAVE ) : void

Parameters
Name Type Description
$tableList
$server
methodpubliceZDBInterface(  $parameters ) : void

Parameters
Name Type Description
$parameters
methodpubliceZTableList(  $server = self::SERVER_MASTER ) : void

Parameters
Name Type Description
$server
methodpublicendTime( ) : void

methodpublicendTimer( ) : void

methodpublicerrorMessage( ) : void

methodpublicerrorNumber( ) : void

methodpublicescapeString(  $str ) : void

Parameters
Name Type Description
$str
methodpublicgenerateFailedTransactionStack( ) : void

methodpublicgenerateFailedTransactionStackEntry(  $stack,  $indentCount ) : void

Parameters
Name Type Description
$stack
$indentCount
methodpublicgenerateSQLINStatement( int | array $elements, string $columnName = '', bool $not = false, \$unique $unique = true, \$type $type = false ) : string

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
Name Type Description
$elements int | array

Elements that should (not) be matched by the IN statment as an integer or anonymous array

$columnName string

Column name of the database table the IN statement should be created for

$not bool

Will generate a "NOT IN" ( if set to \c true ) statement instead of an "IN" ( if set to false , default )

$unique \$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 \$type

The type to cast the array elements to

Returns
Type Description
string A string with the correct IN statement like for example "columnName IN ( element1, element2 )"
methodpublicgenerateTraceEntry(  $entry ) : void

Parameters
Name Type Description
$entry
methodpublicgenerateUniqueTempTableName(  $pattern,  $randomizeIndex = false,  $server = self::SERVER_SLAVE ) : void

Parameters
Name Type Description
$pattern
$randomizeIndex
$server
methodpublichasAttribute(  $name ) : void

Parameters
Name Type Description
$name
methodpublichasRequiredServerVersion(  $minVersion,  $name = false ) : void

Parameters
Name Type Description
$minVersion
$name
methodpublicimplodeWithTypeCast( string $glue, array $pieces, \$type $type ) : string

Casts elements of \a $pieces to type $type and returns them as string separated by $glue.

Parameters
Name Type Description
$glue string

The separator.

$pieces array

The array containing the elements.

$type \$type

The type to cast to.

Returns
Type Description
string
Details
Example
implodeWithTypeCast( ',', $myArray, 'int' )  
Note
: Use generateSQLINStatement() if you intent to use this for IN statments!  
methodpublicinsertFile(  $path,  $sqlFile,  $usePathType = true ) : void

Parameters
Name Type Description
$path
$sqlFile
$usePathType
methodpublicinvalidateTransaction( ) : void

methodpublicisCharsetSupported(  $charset ) : void

Parameters
Name Type Description
$charset
methodpublicisConnected( ) : void

methodpublicisTransactionValid( ) : void

methodpubliclastSerialID(  $table = false,  $column = false ) : void

Parameters
Name Type Description
$table
$column
methodpubliclock(  $table ) : void

Parameters
Name Type Description
$table
methodpublicmd5(  $str ) : void

Parameters
Name Type Description
$str
methodpublicprepareSqlQuery(  $fd,  $buffer ) : void

Parameters
Name Type Description
$fd
$buffer
methodpublicquery(  $sql,  $server = false ) : void

Parameters
Name Type Description
$sql
$server
methodpublicrelationCount(  $relationType = eZDBInterface::RELATION_TABLE ) : void

Parameters
Name Type Description
$relationType
methodpublicrelationCounts(  $relationMask ) : void

Parameters
Name Type Description
$relationMask
methodpublicrelationList(  $relationType = eZDBInterface::RELATION_TABLE ) : void

Parameters
Name Type Description
$relationType
methodpublicrelationMatchRegexp(  $relationType ) : void

Parameters
Name Type Description
$relationType
methodpublicrelationName(  $relationType ) : void

Parameters
Name Type Description
$relationType
methodpublicremoveDatabase(  $dbName ) : void

Parameters
Name Type Description
$dbName
methodpublicremoveRelation(  $relationName,  $relationType ) : void

Parameters
Name Type Description
$relationName
$relationType
methodpublicreportError( ) : void

methodpublicreportQuery(  $class,  $sql,  $numRows,  $timeTaken,  $asDebug = false ) : void

Parameters
Name Type Description
$class
$sql
$numRows
$timeTaken
$asDebug
methodpublicrollback( ) : void

methodpublicrollbackQuery( ) : void

methodpublicsetError( ) : void

methodpublicsetErrorHandling( int $errorHandling ) : void

Sets the eZDB error handling mode

Parameters
Name Type Description
$errorHandling int

Possible values are:pm - eZDB::ERROR_HANDLING_STANDARD: backward compatible error handling, using reportError - eZDB::ERROR_HANDLING_EXCEPTION: using exceptions

Details
Since
4.5  
methodpublicsetIsSQLOutputEnabled(  $enabled ) : void

Parameters
Name Type Description
$enabled
methodpublicsocketPath( ) : void

methodpublicstartTime( ) : void

methodpublicstartTimer( ) : void

methodpublicsubString(  $string,  $from,  $len = null ) : void

Parameters
Name Type Description
$string
$from
$len
methodpublicsupportedRelationTypeMask( ) : void

methodpublicsupportedRelationTypes( ) : void

methodpublicsupportsDefaultValuesInsertion( ) : void

methodpublictimeTaken( ) : void

methodpublictransactionCounter( ) : void

methodpublicunlock( ) : void

methodpublicuseShortNames( ) : void

methodpublicusesBuiltinEncoding( ) : void

methodpublicversion( ) : void

Documentation was generated by DocBlox 0.18.1.