diff --git a/src/Transaction/TransactionInterface.php b/src/Transaction/TransactionInterface.php index 6d91e0862..d577a290f 100644 --- a/src/Transaction/TransactionInterface.php +++ b/src/Transaction/TransactionInterface.php @@ -11,12 +11,15 @@ use Yiisoft\Db\Exception\NotSupportedException; /** - * The TransactionInterface defines the interface for a database transaction. A transaction is a set of operations that - * are executed as a single logical unit of work. The main benefit of using transactions is that they allow for the - * atomic, consistent, isolated for multiple database operations. + * Defines the interface for a database transaction. * - * The TransactionInterface class defines several methods for working with transactions, such as `begin()`, `commit()`, - * and `rollBack()`. + * A transaction is a set of operations that are executed as a single logical unit of work. + * + * The main benefit of using transactions is that they allow for the atomic, consistent, isolated for many database + * operations. + * + * The class defines several methods for working with transactions, such as {@see begin()}, {@see commit()}, and + * {@see rollBack()}. */ interface TransactionInterface extends LoggerAwareInterface { @@ -50,24 +53,25 @@ interface TransactionInterface extends LoggerAwareInterface * * @param string|null $isolationLevel The {@see isolation level}[] to use for this transaction. * This can be one of {@see READ_UNCOMMITTED}, {@see READ_COMMITTED}, {@see REPEATABLE_READ} and {@see SERIALIZABLE} - * but also a string containing DBMS specific syntax to be used after `SET TRANSACTION ISOLATION LEVEL`. + * but also a string containing DBMS-specific syntax to be used after `SET TRANSACTION ISOLATION LEVEL`. + * If not specified (`null`), the isolation level won't be set explicitly and the DBMS default will be used. * - * If not specified (`null`) the isolation level will not be set explicitly and the DBMS default will be used. + * Note: This setting doesn't work for PostgresSQL, where setting the isolation level before the transaction has no + * effect. * - * > Note: This setting does not work for PostgresSQL, where setting the isolation level before the transaction has - * no effect. You have to call {@see setIsolationLevel()} in this case after the transaction has started. + * You have to call {@see setIsolationLevel()} in this case after the transaction has started. * - * > Note: Some (DBMS) allow setting of the isolation level only for the whole connection so subsequent transactions - * may get the same isolation level even if you did not specify any. When using this feature you may need to set the + * Note: Some (DBMS) allow setting of the isolation level only for the whole connection so later transactions may + * get the same isolation level even if you didn't specify any. When using this feature, you may need to set the * isolation level for all transactions explicitly to avoid conflicting settings. * At the time of this writing affected DBMS are MSSQL and SQLite. * - * [isolation level]: http://en.wikipedia.org/wiki/Isolation_%28database_systems%29#Isolation_levels + * @link http://en.wikipedia.org/wiki/Isolation_%28database_systems%29#Isolation_levels * * @throws Exception * @throws Throwable If DB connection fails or the current transaction is active. * @throws InvalidConfigException If {@see \Yiisoft\Db\Connection\ConnectionInterface} is `null` or invalid. - * @throws NotSupportedException If the DBMS does not support nested transactions or the transaction is active. + * @throws NotSupportedException If the DBMS doesn't support nested transactions or the transaction is active. */ public function begin(string $isolationLevel = null): void; @@ -75,7 +79,7 @@ public function begin(string $isolationLevel = null): void; * Commits a transaction. * * @throws Exception - * @throws Throwable If the transaction is not active + * @throws Throwable If the transaction isn't active */ public function commit(): void; @@ -105,24 +109,24 @@ public function rollBack(): void; * Sets the transaction isolation level for this transaction. * * This method can be used to set the isolation level while the transaction is already active. - * However, this is not supported by all DBMS, so you might rather specify the isolation level directly when calling + * However, this isn't supported by all DBMS, so you might rather specify the isolation level directly when calling * {@see begin()}. * * @param string $level The transaction isolation level to use for this transaction. * This can be one of {@see READ_UNCOMMITTED}, {@see READ_COMMITTED}, {@see REPEATABLE_READ} and {@see SERIALIZABLE} - * but also a string containing DBMS specific syntax to be used after `SET TRANSACTION ISOLATION LEVEL`. + * but also a string containing DBMS-specific syntax to be used after `SET TRANSACTION ISOLATION LEVEL`. * * @throws Exception - * @throws Throwable If the transaction is not active. + * @throws Throwable If the transaction isn't active. * - * @see http://en.wikipedia.org/wiki/Isolation_%28database_systems%29#Isolation_levels + * @link http://en.wikipedia.org/wiki/Isolation_%28database_systems%29#Isolation_levels */ public function setIsolationLevel(string $level): void; /** * Creates a new savepoint. * - * @param string $name the savepoint name + * @param string $name The savepoint name. * * @throws Exception * @throws InvalidConfigException @@ -131,9 +135,9 @@ public function setIsolationLevel(string $level): void; public function createSavepoint(string $name): void; /** - * Rolls back to a previously created savepoint. + * Rolls back to a before created savepoint. * - * @param string $name The savepoint name + * @param string $name The savepoint name. * * @throws Exception * @throws InvalidConfigException @@ -144,7 +148,7 @@ public function rollBackSavepoint(string $name): void; /** * Releases an existing savepoint. * - * @param string $name the savepoint name + * @param string $name The savepoint name. * * @throws Exception * @throws InvalidConfigException