Interface

eZ\Publish\Core\Persistence\Database\DatabaseHandler

interface DatabaseHandler implements EzcDbHandler

Interface for relational database abstractions supported by eZ.

Methods

string getName()

Name of the database technology.

beginTransaction()

Begin a transaction.

commit()

Commit a transaction.

rollBack()

Rollback a transaction.

bool useSequences()

Check for sequence based driver or not.

string lastInsertId(string $sequenceName = null)

Retrieve the last auto incremet or sequence id.

exec(string $query)

Execute a query against the database.

object prepare($query)

Prepare and return a statement.

SelectQuery createSelectQuery()

Create Select Query object.

InsertQuery createInsertQuery()

Create Insert Query object.

UpdateQuery createUpdateQuery()

Create update Query object.

DeleteQuery createDeleteQuery()

Create a Delete Query object.

string aliasedColumn(SelectQuery $query, string $columnName, string|null $tableName = null)

Creates an alias for $tableName, $columnName in $query.

string quoteColumn(string $columnName, string $tableName = null)

Returns a qualified identifier for $columnName in $tableName.

string quoteTable(string $tableName)

Returns a qualified identifier for $tableName.

string alias($name, $alias)

Custom alias method.

string quoteIdentifier(string $identifier)

Custom quote identifier method.

mixed getAutoIncrementValue(string $table, string $column)

Get auto increment value.

string getSequenceName(string $table, string $column)

Returns the name of the affected sequence.

mixed getConnection()

Returns underlying connection (e.g.

Details

at line 26
public string getName()

Name of the database technology.

Return Value

string

at line 31
public beginTransaction()

Begin a transaction.

at line 36
public commit()

Commit a transaction.

at line 41
public rollBack()

Rollback a transaction.

at line 48
public bool useSequences()

Check for sequence based driver or not.

Return Value

bool

at line 57
public string lastInsertId(string $sequenceName = null)

Retrieve the last auto incremet or sequence id.

Parameters

string $sequenceName

Return Value

string

at line 64
public exec(string $query)

Execute a query against the database.

Parameters

string $query

at line 73
public object prepare($query)

Prepare and return a statement.

Statements are ducktyped, but need to work like PDOStatement.

Parameters

$query

Return Value

object

at line 80
public SelectQuery createSelectQuery()

Create Select Query object.

Return Value

SelectQuery

at line 87
public InsertQuery createInsertQuery()

Create Insert Query object.

Return Value

InsertQuery

at line 94
public UpdateQuery createUpdateQuery()

Create update Query object.

Return Value

UpdateQuery

at line 101
public DeleteQuery createDeleteQuery()

Create a Delete Query object.

Return Value

DeleteQuery

at line 112
public string aliasedColumn(SelectQuery $query, string $columnName, string|null $tableName = null)

Creates an alias for $tableName, $columnName in $query.

Parameters

SelectQuery $query
string $columnName
string|null $tableName

Return Value

string

at line 122
public string quoteColumn(string $columnName, string $tableName = null)

Returns a qualified identifier for $columnName in $tableName.

Parameters

string $columnName
string $tableName

Return Value

string

at line 131
public string quoteTable(string $tableName)

Returns a qualified identifier for $tableName.

Parameters

string $tableName

Return Value

string

at line 145
public string alias($name, $alias)

Custom alias method.

Ignores some properties of identifier quoting, but since we use somehow sane table and column names, ourselves, this is fine.

This is an optimization and works around the ezcDB implementation.

Parameters

$name
$alias

Return Value

string

at line 159
public string quoteIdentifier(string $identifier)

Custom quote identifier method.

Ignores some properties of identifier quoting, but since we use somehow sane table and column names, ourselves, this is fine.

This is an optimization and works around the ezcDB implementation.

Parameters

string $identifier

Return Value

string

at line 173
public mixed getAutoIncrementValue(string $table, string $column)

Get auto increment value.

Returns the value used for autoincrement tables. Usually this will just be null. In case for sequence based RDBMS this method can return a proper value for the given column.

Parameters

string $table
string $column

Return Value

mixed

at line 183
public string getSequenceName(string $table, string $column)

Returns the name of the affected sequence.

Parameters

string $table
string $column

Return Value

string

at line 190
public mixed getConnection()

Returns underlying connection (e.g.

Doctrine connection object).

Return Value

mixed