MIOLO20
|
Membros públicos | |
__construct (array $params, Driver $driver, Configuration $config=null, EventManager $eventManager=null) | |
getParams () | |
getDatabase () | |
getHost () | |
getPort () | |
getUsername () | |
getPassword () | |
getDriver () | |
getConfiguration () | |
getEventManager () | |
getDatabasePlatform () | |
connect () | |
fetchAssoc ($statement, array $params=array()) | |
fetchArray ($statement, array $params=array()) | |
fetchColumn ($statement, array $params=array(), $colnum=0) | |
isConnected () | |
isTransactionActive () | |
delete ($tableName, array $identifier) | |
close () | |
setTransactionIsolation ($level) | |
getTransactionIsolation () | |
update ($tableName, array $data, array $identifier) | |
insert ($tableName, array $data) | |
setCharset ($charset) | |
quoteIdentifier ($str) | |
quote ($input, $type=null) | |
fetchAll ($sql, array $params=array()) | |
prepare ($statement) | |
executeQuery ($query, array $params=array(), $types=array()) | |
project ($query, array $params, Closure $function) | |
query () | |
executeUpdate ($query, array $params=array(), array $types=array()) | |
exec ($statement) | |
getTransactionNestingLevel () | |
errorCode () | |
errorInfo () | |
lastInsertId ($seqName=null) | |
transactional (Closure $func) | |
setNestTransactionsWithSavepoints ($nestTransactionsWithSavepoints) | |
getNestTransactionsWithSavepoints () | |
beginTransaction () | |
commit () | |
rollback () | |
createSavepoint ($savepoint) | |
releaseSavepoint ($savepoint) | |
rollbackSavepoint ($savepoint) | |
getWrappedConnection () | |
getSchemaManager () | |
setRollbackOnly () | |
isRollbackOnly () | |
convertToDatabaseValue ($value, $type) | |
convertToPHPValue ($value, $type) | |
![]() | |
rollBack () | |
Campos de Dados | |
const | TRANSACTION_READ_UNCOMMITTED = 1 |
const | TRANSACTION_READ_COMMITTED = 2 |
const | TRANSACTION_REPEATABLE_READ = 3 |
const | TRANSACTION_SERIALIZABLE = 4 |
Membros protegidos | |
_getNestedTransactionSavePointName () | |
Atributos Protegidos | |
$_conn | |
$_config | |
$_eventManager | |
$_platform | |
$_schemaManager | |
$_driver | |
A wrapper around a Doctrine\DBAL\Driver\Connection that adds features like events, transaction isolation levels, configuration, emulated transaction nesting, lazy connecting and more.
@license http://www.opensource.org/licenses/lgpl-license.php LGPL 2.0 Guilherme Blanco guilh.nosp@m.erme.nosp@m.blanc.nosp@m.o@ho.nosp@m.tmail.nosp@m..com Jonathan Wage jonwa.nosp@m.ge@g.nosp@m.mail..nosp@m.com Roman Borschel roman.nosp@m.@cod.nosp@m.e-fac.nosp@m.tory.nosp@m..org Konsta Vesterinen kvest.nosp@m.eri@.nosp@m.cc.hu.nosp@m.t.fi Lukas Smith smith.nosp@m.@poo.nosp@m.teewe.nosp@m.et.o.nosp@m.rg (MDB2 library) Benjamin Eberlei konta.nosp@m.kt@b.nosp@m.eberl.nosp@m.ei.d.nosp@m.e
Definido na linha 44 do ficheiro Connection.php.
__construct | ( | array | $params, |
Driver | $driver, | ||
Configuration | $config = null, | ||
EventManager | $eventManager = null ) |
Initializes a new instance of the Connection class.
array | $params | The connection parameters. |
Driver | $driver | |
Configuration | $config | |
EventManager | $eventManager |
Definido na linha 155 do ficheiro Connection.php.
|
protected |
Returns the savepoint name to use for nested transactions are false if they are not supported "savepointFormat" parameter is not set
Definido na linha 785 do ficheiro Connection.php.
beginTransaction | ( | ) |
Starts a transaction by suspending auto-commit mode.
Implementa Connection.
Definido na linha 795 do ficheiro Connection.php.
close | ( | ) |
commit | ( | ) |
Commits the current transaction.
ConnectionException | If the commit failed due to no active transaction or because the transaction was marked for rollback only. |
Implementa Connection.
Definido na linha 815 do ficheiro Connection.php.
connect | ( | ) |
Establishes the connection with the database.
Definido na linha 293 do ficheiro Connection.php.
convertToDatabaseValue | ( | $value, | |
$type ) |
Converts a given value to its database representation according to the conversion rules of a specific DBAL mapping type.
mixed | $value | The value to convert. |
string | $type | The name of the DBAL mapping type. |
Definido na linha 977 do ficheiro Connection.php.
convertToPHPValue | ( | $value, | |
$type ) |
Converts a given value to its PHP representation according to the conversion rules of a specific DBAL mapping type.
mixed | $value | The value to convert. |
string | $type | The name of the DBAL mapping type. |
Definido na linha 990 do ficheiro Connection.php.
createSavepoint | ( | $savepoint | ) |
createSavepoint creates a new savepoint
string | $savepoint | name of a savepoint to set |
Definido na linha 871 do ficheiro Connection.php.
delete | ( | $tableName, | |
array | $identifier ) |
Executes an SQL DELETE statement on a table.
string | $table | The name of the table on which to delete. |
array | $identifier | The deletion criteria. An associateve array containing column-value pairs. |
Definido na linha 381 do ficheiro Connection.php.
errorCode | ( | ) |
Fetch the SQLSTATE associated with the last database operation.
Implementa Connection.
Definido na linha 694 do ficheiro Connection.php.
errorInfo | ( | ) |
Fetch extended error information associated with the last database operation.
Implementa Connection.
Definido na linha 705 do ficheiro Connection.php.
exec | ( | $statement | ) |
Execute an SQL statement and return the number of affected rows.
string | $statement |
Implementa Connection.
Definido na linha 673 do ficheiro Connection.php.
executeQuery | ( | $query, | |
array | $params = array(), | ||
$types = array() ) |
Executes an, optionally parameterized, SQL query.
If the query is parameterized, a prepared statement is used. If an SQLLogger is configured, the execution is logged.
string | $query | The SQL query to execute. |
array | $params | The parameters to bind to the query, if any. |
Definido na linha 559 do ficheiro Connection.php.
executeUpdate | ( | $query, | |
array | $params = array(), | ||
array | $types = array() ) |
Executes an SQL INSERT/UPDATE/DELETE query with the given parameters and returns the number of affected rows.
This method supports PDO binding types as well as DBAL mapping types.
string | $query | The SQL query. |
array | $params | The query parameters. |
array | $types | The parameter types. |
Definido na linha 638 do ficheiro Connection.php.
fetchAll | ( | $sql, | |
array | $params = array() ) |
Prepares and executes an SQL query and returns the result as an associative array.
string | $sql | The SQL query. |
array | $params | The query parameters. |
Definido na linha 530 do ficheiro Connection.php.
fetchArray | ( | $statement, | |
array | $params = array() ) |
Prepares and executes an SQL query and returns the first row of the result as a numerically indexed array.
string | $statement | sql query to be executed |
array | $params | prepared statement params |
Definido na linha 335 do ficheiro Connection.php.
fetchAssoc | ( | $statement, | |
array | $params = array() ) |
Prepares and executes an SQL query and returns the first row of the result as an associative array.
string | $statement | The SQL query. |
array | $params | The query parameters. |
Definido na linha 322 do ficheiro Connection.php.
fetchColumn | ( | $statement, | |
array | $params = array(), | ||
$colnum = 0 ) |
Prepares and executes an SQL query and returns the value of a single column of the first row of the result.
string | $statement | sql query to be executed |
array | $params | prepared statement params |
int | $colnum | 0-indexed column number to retrieve |
Definido na linha 349 do ficheiro Connection.php.
getConfiguration | ( | ) |
Gets the Configuration used by the Connection.
Definido na linha 262 do ficheiro Connection.php.
getDatabase | ( | ) |
Gets the name of the database this Connection is connected to.
Definido na linha 202 do ficheiro Connection.php.
getDatabasePlatform | ( | ) |
Gets the DatabasePlatform for the connection.
Definido na linha 282 do ficheiro Connection.php.
getDriver | ( | ) |
Gets the DBAL driver instance.
Definido na linha 252 do ficheiro Connection.php.
getEventManager | ( | ) |
Gets the EventManager used by the Connection.
Definido na linha 272 do ficheiro Connection.php.
getHost | ( | ) |
Gets the hostname of the currently connected database.
Definido na linha 212 do ficheiro Connection.php.
getNestTransactionsWithSavepoints | ( | ) |
Get if nested transactions should use savepoints
Definido na linha 774 do ficheiro Connection.php.
getParams | ( | ) |
Gets the parameters used during instantiation.
Definido na linha 192 do ficheiro Connection.php.
getPassword | ( | ) |
Gets the password used by this connection.
Definido na linha 242 do ficheiro Connection.php.
getPort | ( | ) |
Gets the port of the currently connected database.
Definido na linha 222 do ficheiro Connection.php.
getSchemaManager | ( | ) |
Gets the SchemaManager that can be used to inspect or change the database schema through the connection.
Definido na linha 932 do ficheiro Connection.php.
getTransactionIsolation | ( | ) |
Gets the currently active transaction isolation level.
Definido na linha 425 do ficheiro Connection.php.
getTransactionNestingLevel | ( | ) |
Returns the current transaction nesting level.
Definido na linha 684 do ficheiro Connection.php.
getUsername | ( | ) |
Gets the username used by this connection.
Definido na linha 232 do ficheiro Connection.php.
getWrappedConnection | ( | ) |
Gets the wrapped driver connection.
Definido na linha 919 do ficheiro Connection.php.
insert | ( | $tableName, | |
array | $data ) |
Inserts a table row with specified data.
string | $table | The name of the table to insert data into. |
array | $data | An associative array containing column-value pairs. |
Definido na linha 461 do ficheiro Connection.php.
isConnected | ( | ) |
Whether an actual connection to the database is established.
Definido na linha 359 do ficheiro Connection.php.
isRollbackOnly | ( | ) |
Check whether the current transaction is marked for rollback only.
ConnectionException | If no transaction is active. |
Definido na linha 961 do ficheiro Connection.php.
isTransactionActive | ( | ) |
Checks whether a transaction is currently active.
Definido na linha 369 do ficheiro Connection.php.
lastInsertId | ( | $seqName = null | ) |
Returns the ID of the last inserted row, or the last value from a sequence object, depending on the underlying driver.
Note: This method may not return a meaningful or consistent result across different drivers, because the underlying database may not even support the notion of AUTO_INCREMENT/IDENTITY columns or sequences.
string | $seqName | Name of the sequence object from which the ID should be returned. |
Implementa Connection.
Definido na linha 722 do ficheiro Connection.php.
prepare | ( | $statement | ) |
Prepares an SQL statement.
string | $statement | The SQL statement to prepare. |
Implementa Connection.
Definido na linha 541 do ficheiro Connection.php.
project | ( | $query, | |
array | $params, | ||
Closure | $function ) |
Executes an, optionally parameterized, SQL query and returns the result, applying a given projection/transformation function on each row of the result.
string | $query | The SQL query to execute. |
array | $params | The parameters, if any. |
Closure | $mapper | The transformation function that is applied on each row. The function receives a single paramater, an array, that represents a row of the result set. |
Definido na linha 598 do ficheiro Connection.php.
query | ( | ) |
Executes an SQL statement, returning a result set as a Statement object.
string | $statement | |
integer | $fetchType |
Implementa Connection.
Definido na linha 619 do ficheiro Connection.php.
quote | ( | $input, | |
$type = null ) |
Quotes a given input parameter.
mixed | $input | Parameter to be quoted. |
string | $type | Type of the parameter. |
Implementa Connection.
Definido na linha 516 do ficheiro Connection.php.
quoteIdentifier | ( | $str | ) |
Quote a string so it can be safely used as a table or column name, even if it is a reserved name.
Delimiting style depends on the underlying database platform that is being used.
NOTE: Just because you CAN use quoted identifiers does not mean you SHOULD use them. In general, they end up causing way more problems than they solve.
string | $str | The name to be quoted. |
Definido na linha 504 do ficheiro Connection.php.
releaseSavepoint | ( | $savepoint | ) |
releaseSavePoint releases given savepoint
string | $savepoint | name of a savepoint to release |
Definido na linha 887 do ficheiro Connection.php.
rollback | ( | ) |
Cancel any database changes done during the current transaction.
this method can be listened with onPreTransactionRollback and onTransactionRollback eventlistener methods
ConnectionException | If the rollback operation failed. |
Definido na linha 843 do ficheiro Connection.php.
rollbackSavepoint | ( | $savepoint | ) |
rollbackSavePoint releases given savepoint
string | $savepoint | name of a savepoint to rollback to |
Definido na linha 905 do ficheiro Connection.php.
setCharset | ( | $charset | ) |
Sets the given charset on the current connection.
string | $charset | The charset to set. |
Definido na linha 486 do ficheiro Connection.php.
setNestTransactionsWithSavepoints | ( | $nestTransactionsWithSavepoints | ) |
Set if nested transactions should use savepoints
boolean |
Definido na linha 756 do ficheiro Connection.php.
setRollbackOnly | ( | ) |
Marks the current transaction so that the only possible outcome for the transaction to be rolled back.
ConnectionException | If no transaction is active. |
Definido na linha 947 do ficheiro Connection.php.
setTransactionIsolation | ( | $level | ) |
Sets the transaction isolation level.
integer | $level | The level to set. |
Definido na linha 413 do ficheiro Connection.php.
transactional | ( | Closure | $func | ) |
Executes a function in a transaction.
The function gets passed this Connection instance as an (optional) parameter.
If an exception occurs during execution of the function or transaction commit, the transaction is rolled back and the exception re-thrown.
Closure | $func | The function to execute transactionally. |
Definido na linha 738 do ficheiro Connection.php.
update | ( | $tableName, | |
array | $data, | ||
array | $identifier ) |
Executes an SQL UPDATE statement on a table.
string | $table | The name of the table to update. |
array | $identifier | The update criteria. An associative array containing column-value pairs. |
Definido na linha 437 do ficheiro Connection.php.
|
protected |
Definido na linha 76 do ficheiro Connection.php.
|
protected |
Definido na linha 71 do ficheiro Connection.php.
|
protected |
Definido na linha 138 do ficheiro Connection.php.
|
protected |
Definido na linha 81 do ficheiro Connection.php.
|
protected |
Definido na linha 124 do ficheiro Connection.php.
|
protected |
Definido na linha 131 do ficheiro Connection.php.
const TRANSACTION_READ_COMMITTED = 2 |
Constant for transaction isolation level READ COMMITTED.
Definido na linha 54 do ficheiro Connection.php.
const TRANSACTION_READ_UNCOMMITTED = 1 |
Constant for transaction isolation level READ UNCOMMITTED.
Definido na linha 49 do ficheiro Connection.php.
const TRANSACTION_REPEATABLE_READ = 3 |
Constant for transaction isolation level REPEATABLE READ.
Definido na linha 59 do ficheiro Connection.php.
const TRANSACTION_SERIALIZABLE = 4 |
Constant for transaction isolation level SERIALIZABLE.
Definido na linha 64 do ficheiro Connection.php.