Closed zluiten closed 2 years ago
Indeed I see this deprecation when running the testsuite
1x: Class "DAMA\DoctrineTestBundle\Doctrine\DBAL\StaticConnection" should implement method "Doctrine\DBAL\Driver\Connection::getNativeConnection(): resource|object".
1x in StaticConnectionFactoryTest::testCreateConnection from Tests\DAMA\DoctrineTestBundle\Doctrine\DBAL
@netiul do you want to contribute the change?
I do. I'll create a PR
The getWrappedConnection method is deprecated since 3.3.0 of the doctrine\dbal.
In case of using the StaticConnection class in userland migrating to the new method
getNativeConnection()
is not possible yet because the class does not implement that function.Concerning upgrade instructions
Add
Connection::getNativeConnection()
Driver and middleware connections need to implement a new method
getNativeConnection()
that gives access to the native database connection. Not doing so is deprecated.Deprecate accessors for the native connection in favor of
getNativeConnection()
The following methods have been deprecated:
Doctrine\DBAL\Driver\PDO\Connection::getWrappedConnection()
Doctrine\DBAL\Driver\PDO\SQLSrv\Connection::getWrappedConnection()
Doctrine\DBAL\Driver\Mysqli\Connection::getWrappedResourceHandle()
Call
getNativeConnection()
to access the underlying PDO or MySQLi connection.