lib/ezdb/classes/ezmysqlidb.php

Show: inherited
Table of Contents

File containing the eZMySQLiDB 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  

\eZMySQLiDB

Package: lib

File containing the eZMySQLiDB class.

Parent(s)
\eZDBInterface
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  RELATION_FOREIGN_KEY = 5
Constant  RELATION_FOREIGN_KEY_BIT = 32
Constant  BINDING_NO = 0
inheritedInherited from: \eZDBInterface::BINDING_NO
Inherited_from
\eZDBInterface::BINDING_NO  
Constant  BINDING_NAME = 1
inheritedInherited from: \eZDBInterface::BINDING_NAME
Inherited_from
\eZDBInterface::BINDING_NAME  
Constant  BINDING_ORDERED = 2
inheritedInherited from: \eZDBInterface::BINDING_ORDERED
Constant  RELATION_TABLE = 0
inheritedInherited from: \eZDBInterface::RELATION_TABLE
Inherited_from
\eZDBInterface::RELATION_TABLE  
Constant  RELATION_SEQUENCE = 1
inheritedInherited from: \eZDBInterface::RELATION_SEQUENCE
Constant  RELATION_TRIGGER = 2
inheritedInherited from: \eZDBInterface::RELATION_TRIGGER
Constant  RELATION_VIEW = 3
inheritedInherited from: \eZDBInterface::RELATION_VIEW
Inherited_from
\eZDBInterface::RELATION_VIEW  
Constant  RELATION_INDEX = 4
inheritedInherited from: \eZDBInterface::RELATION_INDEX
Inherited_from
\eZDBInterface::RELATION_INDEX  
Constant  RELATION_TABLE_BIT = 1
inheritedInherited from: \eZDBInterface::RELATION_TABLE_BIT
Constant  RELATION_SEQUENCE_BIT = 2
inheritedInherited from: \eZDBInterface::RELATION_SEQUENCE_BIT
Constant  RELATION_TRIGGER_BIT = 4
inheritedInherited from: \eZDBInterface::RELATION_TRIGGER_BIT
Constant  RELATION_VIEW_BIT = 8
inheritedInherited from: \eZDBInterface::RELATION_VIEW_BIT
Constant  RELATION_INDEX_BIT = 16
inheritedInherited from: \eZDBInterface::RELATION_INDEX_BIT
Constant  RELATION_NONE = 0
inheritedInherited from: \eZDBInterface::RELATION_NONE
Inherited_from
\eZDBInterface::RELATION_NONE  
Constant  RELATION_MASK = 31
inheritedInherited from: \eZDBInterface::RELATION_MASK
Inherited_from
\eZDBInterface::RELATION_MASK  
Constant  ERROR_MISSING_EXTENSION = 1
inheritedInherited from: \eZDBInterface::ERROR_MISSING_EXTENSION
Constant  SERVER_MASTER = 1
inheritedInherited from: \eZDBInterface::SERVER_MASTER
Inherited_from
\eZDBInterface::SERVER_MASTER  
Constant  SERVER_SLAVE = 2
inheritedInherited from: \eZDBInterface::SERVER_SLAVE
Inherited_from
\eZDBInterface::SERVER_SLAVE  

Properties

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

Error handling mechanism

One of the eZDB::ERROR_HANDLING_* constantsInherited from: \eZDBInterface::$$errorHandling
Default valueeZDB::ERROR_HANDLING_STANDARDDetails
Type
int
Inherited_from
\eZDBInterface::$$errorHandling  

Methods

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

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

Inherited from: \eZDBInterface::attribute()
Parameters
Name Type Description
$name
methodpublicattributes( ) : void
inherited

Inherited from: \eZDBInterface::attributes()
methodpublicavailableDatabases( ) : void

methodpublicbegin( ) : void
inherited

Inherited from: \eZDBInterface::begin()
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
inherited

Inherited from: \eZDBInterface::charset()
methodpubliccheckCharset(  $charset,  $currentCharset ) : void

Parameters
Name Type Description
$charset
$currentCharset
methodpubliccheckCharsetPriv(  $charset,  $currentCharset ) : void

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

methodpubliccommit( ) : void
inherited

Inherited from: \eZDBInterface::commit()
methodpubliccommitQuery( ) : void

methodpublicconcatString(  $strings = array() ) : void

Parameters
Name Type Description
$strings
methodpublicconnect(  $server,  $db,  $user,  $password,  $socketPath,  $charset = null,  $port = false ) : void

Parameters
Name Type Description
$server
$db
$user
$password
$socketPath
$charset
$port
methodpublicconnectRetryCount( ) : void
inherited

Inherited from: \eZDBInterface::connectRetryCount()
methodpublicconnectRetryWaitTime( ) : void
inherited

Inherited from: \eZDBInterface::connectRetryWaitTime()
methodpubliccreateDatabase(  $dbName ) : void

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

Inherited from: \eZDBInterface::createTempTable()
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
inherited

Inherited from: \eZDBInterface::dropTempTableList()
Parameters
Name Type Description
$tableList
$server
methodpubliceZDBInterface(  $parameters ) : void
inherited

Inherited from: \eZDBInterface::eZDBInterface()
Parameters
Name Type Description
$parameters
methodpubliceZMySQLiDB(  $parameters ) : void

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

Parameters
Name Type Description
$server
methodpublicendTime( ) : void
inherited

Inherited from: \eZDBInterface::endTime()
methodpublicendTimer( ) : void
inherited

Inherited from: \eZDBInterface::endTimer()
methodpublicerrorMessage( ) : void
inherited

Inherited from: \eZDBInterface::errorMessage()
methodpublicerrorNumber( ) : void
inherited

Inherited from: \eZDBInterface::errorNumber()
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
inherited

This function can be used to create a SQL IN statement to be used in a WHERE clause:

Inherited from: \eZDBInterface::generateSQLINStatement()

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
inherited

Inherited from: \eZDBInterface::generateTraceEntry()
Parameters
Name Type Description
$entry
methodpublicgenerateUniqueTempTableName(  $pattern,  $randomizeIndex = false,  $server = self::SERVER_SLAVE ) : void
Parameters
Name Type Description
$pattern
$randomizeIndex
$server
methodpublichasAttribute(  $name ) : void
inherited

Inherited from: \eZDBInterface::hasAttribute()
Parameters
Name Type Description
$name
methodpublichasRequiredServerVersion(  $minVersion,  $name = false ) : void
inherited

Inherited from: \eZDBInterface::hasRequiredServerVersion()
Parameters
Name Type Description
$minVersion
$name
methodpublicimplodeWithTypeCast( string $glue, array $pieces, \$type $type ) : string
inherited

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

Inherited from: \eZDBInterface::implodeWithTypeCast()
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
inherited

Inherited from: \eZDBInterface::insertFile()
Parameters
Name Type Description
$path
$sqlFile
$usePathType
methodpublicinvalidateTransaction( ) : void
inherited

Inherited from: \eZDBInterface::invalidateTransaction()
methodpublicisCharsetSupported(  $charset ) : void

Parameters
Name Type Description
$charset
methodpublicisConnected( ) : void
inherited

Inherited from: \eZDBInterface::isConnected()
methodpublicisTransactionValid( ) : void
inherited

Inherited from: \eZDBInterface::isTransactionValid()
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
inherited

Inherited from: \eZDBInterface::prepareSqlQuery()
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 ) : string | false

Local eZDBInterface::relationName() override to support the foreign keys type relation

Parameters
Name Type Description
$relationType
Returns
Type Description
string | false
methodpublicremoveDatabase(  $dbName ) : void

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

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

Inherited from: \eZDBInterface::reportError()
methodpublicreportQuery(  $class,  $sql,  $numRows,  $timeTaken,  $asDebug = false ) : void
inherited

Inherited from: \eZDBInterface::reportQuery()
Parameters
Name Type Description
$class
$sql
$numRows
$timeTaken
$asDebug
methodpublicrollback( ) : void
inherited

Inherited from: \eZDBInterface::rollback()
methodpublicrollbackQuery( ) : void

methodpublicsetError( \MySQLi $connection = false ) : void

Sets the internal error messages & number

Parameters
Name Type Description
$connection \MySQLi

database connection handle, overrides the current one if given

methodpublicsetErrorHandling( int $errorHandling ) : void
inherited

Sets the eZDB error handling mode

Inherited from: \eZDBInterface::setErrorHandling()
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
inherited

Inherited from: \eZDBInterface::setIsSQLOutputEnabled()
Parameters
Name Type Description
$enabled
methodpublicsocketPath( ) : void
inherited

Inherited from: \eZDBInterface::socketPath()
methodpublicstartTime( ) : void
inherited

Inherited from: \eZDBInterface::startTime()
methodpublicstartTimer( ) : void
inherited

Inherited from: \eZDBInterface::startTimer()
methodpublicsubString(  $string,  $from,  $len = null ) : void

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

methodpublicsupportedRelationTypes( ) : void

methodpublicsupportsDefaultValuesInsertion( ) : void

methodpublictimeTaken( ) : void
inherited

Inherited from: \eZDBInterface::timeTaken()
methodpublictransactionCounter( ) : void
inherited

Inherited from: \eZDBInterface::transactionCounter()
methodpublicunlock( ) : void

methodpublicuseShortNames( ) : void
inherited

Inherited from: \eZDBInterface::useShortNames()
methodpublicusesBuiltinEncoding( ) : void
inherited

Inherited from: \eZDBInterface::usesBuiltinEncoding()
methodpublicversion( ) : void
inherited

Inherited from: \eZDBInterface::version()
Documentation was generated by DocBlox 0.18.1.