lib/ezdb/classes/ezmysqlidb.php
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
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

BINDING_NO
= 0
- Inherited_from
- \eZDBInterface::BINDING_NO

BINDING_NAME
= 1
- Inherited_from
- \eZDBInterface::BINDING_NAME

BINDING_ORDERED
= 2
- Inherited_from
- \eZDBInterface::BINDING_ORDERED

RELATION_TABLE
= 0
- Inherited_from
- \eZDBInterface::RELATION_TABLE

RELATION_SEQUENCE
= 1
- Inherited_from
- \eZDBInterface::RELATION_SEQUENCE

RELATION_TRIGGER
= 2
- Inherited_from
- \eZDBInterface::RELATION_TRIGGER

RELATION_VIEW
= 3
- Inherited_from
- \eZDBInterface::RELATION_VIEW

RELATION_INDEX
= 4
- Inherited_from
- \eZDBInterface::RELATION_INDEX

RELATION_TABLE_BIT
= 1
- Inherited_from
- \eZDBInterface::RELATION_TABLE_BIT

RELATION_SEQUENCE_BIT
= 2
- Inherited_from
- \eZDBInterface::RELATION_SEQUENCE_BIT

RELATION_TRIGGER_BIT
= 4
- Inherited_from
- \eZDBInterface::RELATION_TRIGGER_BIT

RELATION_VIEW_BIT
= 8
- Inherited_from
- \eZDBInterface::RELATION_VIEW_BIT

RELATION_INDEX_BIT
= 16
- Inherited_from
- \eZDBInterface::RELATION_INDEX_BIT

RELATION_NONE
= 0
- Inherited_from
- \eZDBInterface::RELATION_NONE

RELATION_MASK
= 31
- Inherited_from
- \eZDBInterface::RELATION_MASK

ERROR_MISSING_EXTENSION
= 1
- Inherited_from
- \eZDBInterface::ERROR_MISSING_EXTENSION

SERVER_MASTER
= 1
- Inherited_from
- \eZDBInterface::SERVER_MASTER

SERVER_SLAVE
= 2
- Inherited_from
- \eZDBInterface::SERVER_SLAVE
Properties


$Charset= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$Charset


$ConnectRetries= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$ConnectRetries


$DB= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$DB


$DBConnection= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$DBConnection


$DBWriteConnection= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$DBWriteConnection


$EndTime= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$EndTime


$ErrorMessage= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$ErrorMessage


$ErrorNumber= '0'
0
Details- Type
- n/a
- Inherited_from
- \eZDBInterface::$$ErrorNumber


$InputTextCodec= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$InputTextCodec


$IsConnected= 'false'
false
Details- Type
- n/a
- Inherited_from
- \eZDBInterface::$$IsConnected


$NumQueries= '0'
0
Details- Type
- n/a
- Inherited_from
- \eZDBInterface::$$NumQueries


$OutputSQL= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$OutputSQL


$OutputTextCodec= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$OutputTextCodec


$Password= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$Password


$Port= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$Port


$RecordError= 'true'
true
Details- Type
- n/a
- Inherited_from
- \eZDBInterface::$$RecordError


$Server= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$Server


$SlaveDB= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$SlaveDB


$SlavePassword= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$SlavePassword


$SlavePort= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$SlavePort


$SlaveServer= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$SlaveServer


$SlaveUser= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$SlaveUser


$SocketPath= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$SocketPath


$StartTime= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$StartTime


$TimeTaken= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$TimeTaken


$TransactionCounter= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$TransactionCounter


$TransactionIsValid= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$TransactionIsValid


$UseBuiltinEncoding= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$UseBuiltinEncoding


$UsePersistentConnection= 'false'
false
Details- Type
- n/a
- Inherited_from
- \eZDBInterface::$$UsePersistentConnection


$UseSlaveServer= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$UseSlaveServer


$User= ''
- Type
- n/a
- Inherited_from
- \eZDBInterface::$$User


int
$errorHandling= 'eZDB::ERROR_HANDLING_STANDARD'
Error handling mechanism
One of the eZDB::ERROR_HANDLING_* constantsInherited from: \eZDBInterface::$$errorHandlingeZDB::ERROR_HANDLING_STANDARD
Details- Type
- int
- Inherited_from
- \eZDBInterface::$$errorHandling
Methods


arrayQuery(
$sql, $params
=
array(), $server
=
false
)
:
void
Name | Type | Description |
---|---|---|
$sql | ||
$params | ||
$server |


attribute(
$name
)
:
void
Name | Type | Description |
---|---|---|
$name |


checkCharset(
$charset, $currentCharset
)
:
void
Name | Type | Description |
---|---|---|
$charset | ||
$currentCharset |


checkCharsetPriv(
$charset, $currentCharset
)
:
void
Name | Type | Description |
---|---|---|
$charset | ||
$currentCharset |


connect(
$server, $db, $user, $password, $socketPath, $charset
=
null, $port
=
false
)
:
void
Name | Type | Description |
---|---|---|
$server | ||
$db | ||
$user | ||
$password | ||
$socketPath | ||
$charset | ||
$port |


createTempTable(
$createTableQuery
=
'', $server
=
self::SERVER_SLAVE
)
:
void
Name | Type | Description |
---|---|---|
$createTableQuery | ||
$server |


dropTempTable(
$dropTableQuery
=
'', $server
=
self::SERVER_SLAVE
)
:
void
Name | Type | Description |
---|---|---|
$dropTableQuery | ||
$server |


dropTempTableList(
$tableList, $server
=
self::SERVER_SLAVE
)
:
void
Name | Type | Description |
---|---|---|
$tableList | ||
$server |


eZDBInterface(
$parameters
)
:
void
Name | Type | Description |
---|---|---|
$parameters |


eZTableList(
$server
=
eZDBInterface::SERVER_MASTER
)
:
void
Name | Type | Description |
---|---|---|
$server |


generateFailedTransactionStack(
)
:
void


generateFailedTransactionStackEntry(
$stack, $indentCount
)
:
void
Name | Type | Description |
---|---|---|
$stack | ||
$indentCount |


generateSQLINStatement(
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:
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, ) );
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 |
Type | Description |
---|---|
string | A string with the correct IN statement like for example "columnName IN ( element1, element2 )" |


generateTraceEntry(
$entry
)
:
void
Name | Type | Description |
---|---|---|
$entry |


generateUniqueTempTableName(
$pattern, $randomizeIndex
=
false, $server
=
self::SERVER_SLAVE
)
:
void
Name | Type | Description |
---|---|---|
$pattern | ||
$randomizeIndex | ||
$server |


hasAttribute(
$name
)
:
void
Name | Type | Description |
---|---|---|
$name |


hasRequiredServerVersion(
$minVersion, $name
=
false
)
:
void
Name | Type | Description |
---|---|---|
$minVersion | ||
$name |


implodeWithTypeCast(
string $glue, array $pieces, \$type $type
)
:
string
Casts elements of \a $pieces to type $type and returns them as string separated by $glue.
Inherited from: \eZDBInterface::implodeWithTypeCast()Name | Type | Description |
---|---|---|
$glue | string | The separator. |
$pieces | array | The array containing the elements. |
$type | \$type | The type to cast to. |
Type | Description |
---|---|
string |
- Example
- implodeWithTypeCast( ',', $myArray, 'int' )
- Note
- : Use generateSQLINStatement() if you intent to use this for IN statments!


insertFile(
$path, $sqlFile, $usePathType
=
true
)
:
void
Name | Type | Description |
---|---|---|
$path | ||
$sqlFile | ||
$usePathType |


lastSerialID(
$table
=
false, $column
=
false
)
:
void
Name | Type | Description |
---|---|---|
$table | ||
$column |


prepareSqlQuery(
$fd, $buffer
)
:
void
Name | Type | Description |
---|---|---|
$fd | ||
$buffer |


relationCount(
$relationType
=
eZDBInterface::RELATION_TABLE
)
:
void
Name | Type | Description |
---|---|---|
$relationType |


relationList(
$relationType
=
eZDBInterface::RELATION_TABLE
)
:
void
Name | Type | Description |
---|---|---|
$relationType |


relationName(
$relationType
)
:
string | false
Local eZDBInterface::relationName() override to support the foreign keys type relation
Name | Type | Description |
---|---|---|
$relationType |
Type | Description |
---|---|
string | false |


removeRelation(
$relationName, $relationType
)
:
void
Name | Type | Description |
---|---|---|
$relationName | ||
$relationType |


reportQuery(
$class, $sql, $numRows, $timeTaken, $asDebug
=
false
)
:
void
Name | Type | Description |
---|---|---|
$class | ||
$sql | ||
$numRows | ||
$timeTaken | ||
$asDebug |


setError(
\MySQLi $connection
=
false
)
:
void
Sets the internal error messages & number
Name | Type | Description |
---|---|---|
$connection | \MySQLi | database connection handle, overrides the current one if given |


setErrorHandling(
int $errorHandling
)
:
void
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 |
- Since
- 4.5


setIsSQLOutputEnabled(
$enabled
)
:
void
Name | Type | Description |
---|---|---|
$enabled |