Class

eZ\Publish\Core\Persistence\Doctrine\ConnectionHandler\SqliteConnectionHandler

class SqliteConnectionHandler extends ConnectionHandler

Methods

static Connection createConnectionFromDSN(string|array $dsn)

from ConnectionHandler
static ConnectionHandler createFromConnection(Connection $connection)

Create a Connection Handler from given Doctrine $connection.

from ConnectionHandler
static ConnectionHandler createFromDSN(string|array $dsn)

Create a Connection Handler with corresponding Doctrine connection from DSN.

from ConnectionHandler
static array parseDSN(string $dsn)

Returns the Data Source Name as a structure containing the various parts of the DSN.

from ConnectionHandler
__construct(Connection $connection)

from ConnectionHandler
Connection getConnection()

from ConnectionHandler
string getName()

from ConnectionHandler
beginTransaction()

Begin a transaction.

from ConnectionHandler
commit()

Commit a transaction.

from ConnectionHandler
rollBack()

Rollback a transaction.

from ConnectionHandler
object prepare($query)

Prepare and return a statement.

from ConnectionHandler
string lastInsertId(string $sequenceName = null)

Retrieve the last auto incremet or sequence id.

bool useSequences()

from ConnectionHandler
exec(string $query)

Execute a query against the database.

from ConnectionHandler
SelectQuery createSelectQuery()

Create Select Query object.

from ConnectionHandler
InsertQuery createInsertQuery()

Create Insert Query object.

from ConnectionHandler
UpdateQuery createUpdateQuery()

Create update Query object.

from ConnectionHandler
DeleteQuery createDeleteQuery()

Create a Delete Query object.

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

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

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

Returns a qualified identifier for $columnName in $tableName.

from ConnectionHandler
string quoteTable(string $tableName)

Returns a qualified identifier for $tableName.

from ConnectionHandler
string alias($name, $alias)

Custom alias method.

from ConnectionHandler
string quoteIdentifier(string $identifier)

Custom quote identifier method.

from ConnectionHandler
mixed getAutoIncrementValue(string $table, string $column)

Get auto increment value.

string getSequenceName(string $table, string $column)

Returns the name of the affected sequence.

Details

in ConnectionHandler at line 35
static public Connection createConnectionFromDSN(string|array $dsn)

Parameters

string|array $dsn

Return Value

Connection

in ConnectionHandler at line 56
static public ConnectionHandler createFromConnection(Connection $connection)

Create a Connection Handler from given Doctrine $connection.

Parameters

Connection $connection

Return Value

ConnectionHandler

in ConnectionHandler at line 78
static public ConnectionHandler createFromDSN(string|array $dsn)

Create a Connection Handler with corresponding Doctrine connection from DSN.

Parameters

string|array $dsn

Return Value

ConnectionHandler

in ConnectionHandler at line 134
static public array parseDSN(string $dsn)

Returns the Data Source Name as a structure containing the various parts of the DSN.

Additional keys can be added by appending a URI query string to the end of the DSN.

The format of the supplied DSN is in its fullest form: driver://user:password@protocol+host/database?option=8&another=true

Most variations are allowed: driver://user:password@protocol+host:110//usr/db_file.db?mode=0644 driver://user:password@host/dbname driver://user:password@host driver://user@host driver://host/dbname driver://host driver

This function is 'borrowed' from PEAR /DB.php .

Parameters

string $dsn Data Source Name to be parsed

Return Value

array an associative array with the following keys: + driver: Database backend used in PHP (mysql, odbc etc.) + host: Host specification (hostname[:port]) + dbname: Database to use on the DBMS server + username: User name for login + password: Password for login

in ConnectionHandler at line 274
public __construct(Connection $connection)

Parameters

Connection $connection

in ConnectionHandler at line 282
public Connection getConnection()

Return Value

Connection

in ConnectionHandler at line 290
public string getName()

Return Value

string

in ConnectionHandler at line 298
public beginTransaction()

Begin a transaction.

in ConnectionHandler at line 310
public commit()

Commit a transaction.

in ConnectionHandler at line 322
public rollBack()

Rollback a transaction.

in ConnectionHandler at line 331
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 24
public string lastInsertId(string $sequenceName = null)

Retrieve the last auto incremet or sequence id.

Parameters

string $sequenceName

Return Value

string

in ConnectionHandler at line 351
public bool useSequences()

Return Value

bool

in ConnectionHandler at line 361
public exec(string $query)

Execute a query against the database.

Parameters

string $query

in ConnectionHandler at line 375
public SelectQuery createSelectQuery()

Create Select Query object.

Return Value

SelectQuery

in ConnectionHandler at line 385
public InsertQuery createInsertQuery()

Create Insert Query object.

Return Value

InsertQuery

in ConnectionHandler at line 395
public UpdateQuery createUpdateQuery()

Create update Query object.

Return Value

UpdateQuery

in ConnectionHandler at line 405
public DeleteQuery createDeleteQuery()

Create a Delete Query object.

Return Value

DeleteQuery

in ConnectionHandler at line 419
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

in ConnectionHandler at line 438
public string quoteColumn(string $columnName, string $tableName = null)

Returns a qualified identifier for $columnName in $tableName.

Parameters

string $columnName
string $tableName

Return Value

string

in ConnectionHandler at line 452
public string quoteTable(string $tableName)

Returns a qualified identifier for $tableName.

Parameters

string $tableName

Return Value

string

in ConnectionHandler at line 469
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

in ConnectionHandler at line 486
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 48
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 103
public string getSequenceName(string $table, string $column)

Returns the name of the affected sequence.

Parameters

string $table
string $column

Return Value

string