From dea50c9e5e31a363d1ca42fa9435ad6e2734732d Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 3 Sep 2024 15:58:35 +0200 Subject: [PATCH] removed IConnection (BC break) --- src/Dibi/Connection.php | 2 +- src/Dibi/interfaces.php | 60 ----------------------------------------- 2 files changed, 1 insertion(+), 61 deletions(-) diff --git a/src/Dibi/Connection.php b/src/Dibi/Connection.php index 916d095..3cb40ea 100644 --- a/src/Dibi/Connection.php +++ b/src/Dibi/Connection.php @@ -19,7 +19,7 @@ use Traversable; * @property-read int $affectedRows * @property-read int $insertId */ -class Connection implements IConnection +class Connection { /** function (Event $event); Occurs after query is executed */ public ?array $onEvent = []; diff --git a/src/Dibi/interfaces.php b/src/Dibi/interfaces.php index 3cf3368..753d0b6 100644 --- a/src/Dibi/interfaces.php +++ b/src/Dibi/interfaces.php @@ -178,63 +178,3 @@ interface Reflector */ function getForeignKeys(string $table): array; } - - -/** - * Dibi connection. - */ -interface IConnection -{ - /** - * Connects to a database. - */ - function connect(): void; - - /** - * Disconnects from a database. - */ - function disconnect(): void; - - /** - * Returns true when connection was established. - */ - function isConnected(): bool; - - /** - * Returns the driver and connects to a database in lazy mode. - */ - function getDriver(): Driver; - - /** - * Generates (translates) and executes SQL query. - * @throws Exception - */ - function query(...$args): Result; - - /** - * Gets the number of affected rows by the last INSERT, UPDATE or DELETE query. - * @throws Exception - */ - function getAffectedRows(): int; - - /** - * Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query. - * @throws Exception - */ - function getInsertId(?string $sequence = null): int; - - /** - * Begins a transaction (if supported). - */ - function begin(?string $savepoint = null): void; - - /** - * Commits statements in a transaction. - */ - function commit(?string $savepoint = null): void; - - /** - * Rollback changes in a transaction. - */ - function rollback(?string $savepoint = null): void; -}