lib/ezdb/classes/ezdbinterface.php
\eZDBInterface
- Children
- \eZMySQLDB
- \eZMySQLiDB
- \eZNullDB
- \eZPostgreSQLDB
Constants
Properties
Methods

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

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

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 |

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

generateSQLINStatement(
int | array $elements, string $columnName
=
'', bool $not
=
false, \$unique $unique
=
true, \$type $type
=
false
)
:
stringThis 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, ) );
| 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 )" |

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

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

implodeWithTypeCast(
string $glue, array $pieces, \$type $type
)
:
stringCasts elements of \a $pieces to type $type and returns them as string separated by $glue.
| 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 |

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

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

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 |