Skip to content

Commit

Permalink
[doctrineGH-4163] Add deprecation for Connection::exec, executeUpdate…
Browse files Browse the repository at this point in the history
…, query APIs.
  • Loading branch information
beberlei committed Mar 6, 2021
1 parent 5418d32 commit 6abdbb9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/Doctrine/DBAL/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,12 @@ public function project($sql, array $params, Closure $function)
*/
public function query()
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/4163',
'Connection::query() is deprecated, use Connection::executeQuery() instead.'
);

$connection = $this->getWrappedConnection();

$args = func_get_args();
Expand Down Expand Up @@ -1441,6 +1447,12 @@ public function query()
*/
public function executeUpdate($sql, array $params = [], array $types = [])
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/4163',
'Connection::executeUpdate() is deprecated, use Connection::executeStatement() instead.'
);

return $this->executeStatement($sql, $params, $types);
}

Expand Down Expand Up @@ -1519,6 +1531,12 @@ public function executeStatement($sql, array $params = [], array $types = [])
*/
public function exec($sql)
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/4163',
'Connection::exec() is deprecated, use Connection::executeStatement() instead.'
);

$connection = $this->getWrappedConnection();

$logger = $this->_config->getSQLLogger();
Expand Down

0 comments on commit 6abdbb9

Please sign in to comment.