From 35e9150dd4813b6460cb3e0148a5ac241e95508e Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Fri, 10 Jul 2020 19:04:16 -0700 Subject: [PATCH] Deprecate query() and exec() in favor of executeQuery() and executeStatement() --- UPGRADE.md | 2 ++ lib/Doctrine/DBAL/Connection.php | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index ea130f7714..c6765ebf1b 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -3,6 +3,8 @@ ## Deprecations in the wrapper `Connection` class 1. The `executeUpdate()` method has been deprecated in favor of `executeStatement()`. +2. The `query()` method has been deprecated in favor of `executeQuery()`. +3. The `exec()` method has been deprecated in favor of `executeStatement()`. ## PDO-related classes outside of the PDO namespace are deprecated diff --git a/lib/Doctrine/DBAL/Connection.php b/lib/Doctrine/DBAL/Connection.php index 3aa16f2b20..cd4c33109e 100644 --- a/lib/Doctrine/DBAL/Connection.php +++ b/lib/Doctrine/DBAL/Connection.php @@ -1249,6 +1249,8 @@ public function project($query, array $params, Closure $function) /** * Executes an SQL statement, returning a result set as a Statement object. * + * @deprecated Use {@link executeQuery()} instead. + * * @return \Doctrine\DBAL\Driver\Statement * * @throws DBALException @@ -1360,6 +1362,8 @@ public function executeStatement($sql, array $params = [], array $types = []) /** * Executes an SQL statement and return the number of affected rows. * + * @deprecated Use {@link executeStatement()} instead. + * * @param string $statement * * @return int The number of affected rows.