Property | Type | Description | |
---|---|---|---|
$_config | Doctrine\DBAL\Configuration | ||
$_conn | Doctrine\DBAL\Driver\Connection | The wrapped driver connection. | |
$_driver | Doctrine\DBAL\Driver | The used DBAL driver. | |
$_eventManager | Doctrine\Common\EventManager | ||
$_expr | Doctrine\DBAL\Query\Expression\ExpressionBuilder | ||
$_schemaManager | Doctrine\DBAL\Schema\AbstractSchemaManager | The schema manager. | |
$defaultFetchMode | integer |
Method | Description | |
---|---|---|
__construct ( array $params, Doctrine\DBAL\Driver $driver, Doctrine\DBAL\Configuration $config = null, Doctrine\Common\EventManager $eventManager = null ) | Initializes a new instance of the Connection class. | |
beginTransaction ( ) : void | Starts a transaction by suspending auto-commit mode. | |
close ( ) : void | Closes the connection. | |
commit ( ) : void | Commits the current transaction. | |
connect ( ) : boolean | Establishes the connection with the database. | |
convertToDatabaseValue ( mixed $value, string $type ) : mixed | Converts a given value to its database representation according to the conversion rules of a specific DBAL mapping type. | |
convertToPHPValue ( mixed $value, string $type ) : mixed | Converts a given value to its PHP representation according to the conversion rules of a specific DBAL mapping type. | |
createQueryBuilder ( ) : Doctrine\DBAL\Query\QueryBuilder | Creates a new instance of a SQL query builder. | |
createSavepoint ( string $savepoint ) : void | Creates a new savepoint. | |
delete ( string $tableExpression, array $identifier, array $types = [] ) : integer | Executes an SQL DELETE statement on a table. | |
errorCode ( ) : integer | Fetches the SQLSTATE associated with the last database operation. | |
errorInfo ( ) : array | Fetches extended error information associated with the last database operation. | |
exec ( string $statement ) : integer | Executes an SQL statement and return the number of affected rows. | |
executeCacheQuery ( string $query, array $params, array $types, Doctrine\DBAL\Cache\QueryCacheProfile $qcp ) : Doctrine\DBAL\Driver\ResultStatement | Executes a caching query. | |
executeQuery ( string $query, array $params = [], array $types = [], Doctrine\DBAL\Cache\QueryCacheProfile $qcp = null ) : Doctrine\DBAL\Driver\Statement | Executes an, optionally parametrized, SQL query. | |
executeUpdate ( string $query, array $params = [], array $types = [] ) : integer | Executes an SQL INSERT/UPDATE/DELETE query with the given parameters and returns the number of affected rows. | |
fetchAll ( string $sql, array $params = [], array $types = [] ) : array | Prepares and executes an SQL query and returns the result as an associative array. | |
fetchArray ( string $statement, array $params = [], array $types = [] ) : array | boolean | Prepares and executes an SQL query and returns the first row of the result as a numerically indexed array. | |
fetchAssoc ( string $statement, array $params = [], array $types = [] ) : array | boolean | Prepares and executes an SQL query and returns the first row of the result as an associative array. | |
fetchColumn ( string $statement, array $params = [], integer $column, array $types = [] ) : mixed | boolean | Prepares and executes an SQL query and returns the value of a single column of the first row of the result. | |
getConfiguration ( ) : Doctrine\DBAL\Configuration | Gets the Configuration used by the Connection. | |
getDatabase ( ) : string | Gets the name of the database this Connection is connected to. | |
getDatabasePlatform ( ) : Doctrine\DBAL\Platforms\AbstractPlatform | Gets the DatabasePlatform for the connection. | |
getDriver ( ) : Doctrine\DBAL\Driver | Gets the DBAL driver instance. | |
getEventManager ( ) : Doctrine\Common\EventManager | Gets the EventManager used by the Connection. | |
getExpressionBuilder ( ) : Doctrine\DBAL\Query\Expression\ExpressionBuilder | Gets the ExpressionBuilder for the connection. | |
getHost ( ) : string | null | Gets the hostname of the currently connected database. | |
getNestTransactionsWithSavepoints ( ) : boolean | Gets if nested transactions should use savepoints. | |
getParams ( ) : array | Gets the parameters used during instantiation. | |
getPassword ( ) : string | null | Gets the password used by this connection. | |
getPort ( ) : mixed | Gets the port of the currently connected database. | |
getSchemaManager ( ) : Doctrine\DBAL\Schema\AbstractSchemaManager | Gets the SchemaManager that can be used to inspect or change the database schema through the connection. | |
getTransactionIsolation ( ) : integer | Gets the currently active transaction isolation level. | |
getTransactionNestingLevel ( ) : integer | Returns the current transaction nesting level. | |
getUsername ( ) : string | null | Gets the username used by this connection. | |
getWrappedConnection ( ) : Doctrine\DBAL\Driver\Connection | Gets the wrapped driver connection. | |
insert ( string $tableExpression, array $data, array $types = [] ) : integer | Inserts a table row with specified data. | |
isAutoCommit ( ) : boolean | Returns the current auto-commit mode for this connection. | |
isConnected ( ) : boolean | Whether an actual connection to the database is established. | |
isRollbackOnly ( ) : boolean | Checks whether the current transaction is marked for rollback only. | |
isTransactionActive ( ) : boolean | Checks whether a transaction is currently active. | |
lastInsertId ( string | null $seqName = null ) : string | Returns the ID of the last inserted row, or the last value from a sequence object, depending on the underlying driver. | |
ping ( ) : boolean | Ping the server | |
prepare ( string $statement ) : |
Prepares an SQL statement. | |
project ( string $query, array $params, Closur\Closure $function ) : array | Executes an, optionally parametrized, SQL query and returns the result, applying a given projection/transformation function on each row of the result. | |
query ( ) : Doctrine\DBAL\Driver\Statement | Executes an SQL statement, returning a result set as a Statement object. | |
quote ( mixed $input, string | null $type = null ) : string | Quotes a given input parameter. | |
quoteIdentifier ( string $str ) : string | Quotes a string so it can be safely used as a table or column name, even if it is a reserved name. | |
releaseSavepoint ( string $savepoint ) : void | Releases the given savepoint. | |
resolveParams ( array $params, array $types ) : array | Resolves the parameters to a format which can be displayed. | |
rollBack ( ) | Cancels any database changes done during the current transaction. | |
rollbackSavepoint ( string $savepoint ) : void | Rolls back to the given savepoint. | |
setAutoCommit ( boolean $autoCommit ) | Sets auto-commit mode for this connection. | |
setFetchMode ( integer $fetchMode ) : void | Sets the fetch mode. | |
setNestTransactionsWithSavepoints ( boolean $nestTransactionsWithSavepoints ) : void | Sets if nested transactions should use savepoints. | |
setRollbackOnly ( ) : void | Marks the current transaction so that the only possible outcome for the transaction to be rolled back. | |
setTransactionIsolation ( integer $level ) : integer | Sets the transaction isolation level. | |
transactional ( Closur\Closure $func ) : mixed | Executes a function in a transaction. | |
update ( string $tableExpression, array $data, array $identifier, array $types = [] ) : integer | Executes an SQL UPDATE statement on a table. |
Method | Description | |
---|---|---|
_getNestedTransactionSavePointName ( ) : mixed | Returns the savepoint name to use for nested transactions are false if they are not supported "savepointFormat" parameter is not set |
Method | Description | |
---|---|---|
_bindTypedValues ( Doctrine\DBAL\Driver\Statement $stmt, array $params, array $types ) : void | Binds a set of parameters, some or all of which are typed with a PDO binding type or DBAL mapping type, to a given statement. | |
commitAll ( ) | Commits all current nesting transactions. | |
detectDatabasePlatform ( ) | Detects and sets the database platform. | |
extractTypeValues ( array $data, array $types ) : array | Extract ordered type list from two associate key lists of data and types. | |
getBindingInfo ( mixed $value, mixed $type ) : array | Gets the binding type of a given type. The given type can be a PDO or DBAL mapping type. | |
getDatabasePlatformVersion ( ) : string | null | Returns the version of the related platform if applicable. |
public __construct ( array $params, Doctrine\DBAL\Driver $driver, Doctrine\DBAL\Configuration $config = null, Doctrine\Common\EventManager $eventManager = null ) | ||
$params | array | The connection parameters. |
$driver | Doctrine\DBAL\Driver | The driver to use. |
$config | Doctrine\DBAL\Configuration | The configuration, optional. |
$eventManager | Doctrine\Common\EventManager | The event manager, optional. |
protected _getNestedTransactionSavePointName ( ) : mixed | ||
return | mixed | A string with the savepoint name or false. |
public beginTransaction ( ) : void | ||
return | void |
public createQueryBuilder ( ) : Doctrine\DBAL\Query\QueryBuilder | ||
return | Doctrine\DBAL\Query\QueryBuilder |
public createSavepoint ( string $savepoint ) : void | ||
$savepoint | string | The name of the savepoint to create. |
return | void |
public delete ( string $tableExpression, array $identifier, array $types = [] ) : integer | ||
$tableExpression | string | The expression of the table on which to delete. |
$identifier | array | The deletion criteria. An associative array containing column-value pairs. |
$types | array | The types of identifiers. |
return | integer | The number of affected rows. |
public executeCacheQuery ( string $query, array $params, array $types, Doctrine\DBAL\Cache\QueryCacheProfile $qcp ) : Doctrine\DBAL\Driver\ResultStatement | ||
$query | string | The SQL query to execute. |
$params | array | The parameters to bind to the query, if any. |
$types | array | The types the previous parameters are in. |
$qcp | Doctrine\DBAL\Cache\QueryCacheProfile | The query cache profile. |
return | Doctrine\DBAL\Driver\ResultStatement |
public executeQuery ( string $query, array $params = [], array $types = [], Doctrine\DBAL\Cache\QueryCacheProfile $qcp = null ) : Doctrine\DBAL\Driver\Statement | ||
$query | string | The SQL query to execute. |
$params | array | The parameters to bind to the query, if any. |
$types | array | The types the previous parameters are in. |
$qcp | Doctrine\DBAL\Cache\QueryCacheProfile | The query cache profile, optional. |
return | Doctrine\DBAL\Driver\Statement | The executed statement. |
public fetchColumn ( string $statement, array $params = [], integer $column, array $types = [] ) : mixed | boolean | ||
$statement | string | The SQL query to be executed. |
$params | array | The prepared statement params. |
$column | integer | The 0-indexed column number to retrieve. |
$types | array | The query parameter types. |
return | mixed | boolean | False is returned if no rows are found. |
public getConfiguration ( ) : Doctrine\DBAL\Configuration | ||
return | Doctrine\DBAL\Configuration |
public getDatabase ( ) : string | ||
return | string |
public getDatabasePlatform ( ) : Doctrine\DBAL\Platforms\AbstractPlatform | ||
return | Doctrine\DBAL\Platforms\AbstractPlatform |
public getDriver ( ) : Doctrine\DBAL\Driver | ||
return | Doctrine\DBAL\Driver |
public getEventManager ( ) : Doctrine\Common\EventManager | ||
return | Doctrine\Common\EventManager |
public getExpressionBuilder ( ) : Doctrine\DBAL\Query\Expression\ExpressionBuilder | ||
return | Doctrine\DBAL\Query\Expression\ExpressionBuilder |
public getNestTransactionsWithSavepoints ( ) : boolean | ||
return | boolean |
public getPassword ( ) : string | null | ||
return | string | null |
public getSchemaManager ( ) : Doctrine\DBAL\Schema\AbstractSchemaManager | ||
return | Doctrine\DBAL\Schema\AbstractSchemaManager |
public getTransactionIsolation ( ) : integer | ||
return | integer | The current transaction isolation level. |
public getTransactionNestingLevel ( ) : integer | ||
return | integer | The nesting level. A value of 0 means there's no active transaction. |
public getUsername ( ) : string | null | ||
return | string | null |
public getWrappedConnection ( ) : Doctrine\DBAL\Driver\Connection | ||
return | Doctrine\DBAL\Driver\Connection |
public insert ( string $tableExpression, array $data, array $types = [] ) : integer | ||
$tableExpression | string | The expression of the table to insert data into, quoted or unquoted. |
$data | array | An associative array containing column-value pairs. |
$types | array | Types of the inserted data. |
return | integer | The number of affected rows. |
public isAutoCommit ( ) : boolean | ||
return | boolean | True if auto-commit mode is currently enabled for this connection, false otherwise. |
public isConnected ( ) : boolean | ||
return | boolean |
public isRollbackOnly ( ) : boolean | ||
return | boolean |
public isTransactionActive ( ) : boolean | ||
return | boolean | TRUE if a transaction is currently active, FALSE otherwise. |
public project ( string $query, array $params, Closur\Closure $function ) : array | ||
$query | string | The SQL query to execute. |
$params | array | The parameters, if any. |
$function | Closur\Closure | The transformation function that is applied on each row. The function receives a single parameter, an array, that represents a row of the result set. |
return | array | The projected result of the query. |
public query ( ) : Doctrine\DBAL\Driver\Statement | ||
return | Doctrine\DBAL\Driver\Statement |
public quoteIdentifier ( string $str ) : string | ||
$str | string | The name to be quoted. |
return | string | The quoted name. |
public releaseSavepoint ( string $savepoint ) : void | ||
$savepoint | string | The name of the savepoint to release. |
return | void |
public rollBack ( ) |
public rollbackSavepoint ( string $savepoint ) : void | ||
$savepoint | string | The name of the savepoint to rollback to. |
return | void |
public setAutoCommit ( boolean $autoCommit ) | ||
$autoCommit | boolean | True to enable auto-commit mode; false to disable it. |
public setFetchMode ( integer $fetchMode ) : void | ||
$fetchMode | integer | |
return | void |
public setNestTransactionsWithSavepoints ( boolean $nestTransactionsWithSavepoints ) : void | ||
$nestTransactionsWithSavepoints | boolean | |
return | void |
public setRollbackOnly ( ) : void | ||
return | void |
public setTransactionIsolation ( integer $level ) : integer | ||
$level | integer | The level to set. |
return | integer |
public transactional ( Closur\Closure $func ) : mixed | ||
$func | Closur\Closure | The function to execute transactionally. |
return | mixed | The value returned by $func |
public update ( string $tableExpression, array $data, array $identifier, array $types = [] ) : integer | ||
$tableExpression | string | The expression of the table to update quoted or unquoted. |
$data | array | An associative array containing column-value pairs. |
$identifier | array | The update criteria. An associative array containing column-value pairs. |
$types | array | Types of the merged $data and $identifier arrays in that order. |
return | integer | The number of affected rows. |
protected Configuration,Doctrine\DBAL $_config | ||
return | Doctrine\DBAL\Configuration |
protected Connection,Doctrine\DBAL\Driver $_conn | ||
return | Doctrine\DBAL\Driver\Connection |
protected Driver,Doctrine\DBAL $_driver | ||
return | Doctrine\DBAL\Driver |
protected EventManager,Doctrine\Common $_eventManager | ||
return | Doctrine\Common\EventManager |
protected ExpressionBuilder,Doctrine\DBAL\Query\Expression $_expr | ||
return | Doctrine\DBAL\Query\Expression\ExpressionBuilder |
protected AbstractSchemaManager,Doctrine\DBAL\Schema $_schemaManager | ||
return | Doctrine\DBAL\Schema\AbstractSchemaManager |