Skip to content

Commit 1a0a211

Browse files
authored
Fix the portability documentation (#6429)
| Q | A |------------- | ----------- | Type | documentation | Fixed issues | n/a #### Summary The Portability connection is not a valid wrapper class as it does not extend `Doctrine\DBAL\Connection`. The way to use it is through the middleware, to wrap the driver connection.
1 parent 537e6b3 commit 1a0a211

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

docs/en/reference/portability.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,16 @@ Using the following code block in your initialization will:
5151
<?php
5252
5353
use Doctrine\DBAL\ColumnCase;
54+
use Doctrine\DBAL\Configuration;
5455
use Doctrine\DBAL\Portability\Connection as PortableConnection;
56+
use Doctrine\DBAL\Portability\Middleware as PotableMiddleware;
5557
56-
$params = [
57-
// vendor specific configuration
58+
$configuration = new Configuration();
59+
$configuration->setMiddlewares([
60+
// Other middlewares
5861
//...
59-
'wrapperClass' => PortableConnection::class,
60-
'portability' => PortableConnection::PORTABILITY_ALL,
61-
'fetch_case' => ColumnCase::LOWER,
62-
];
62+
new PortableMiddleware(PortableConnection::PORTABILITY_ALL, ColumnCase::LOWER),
63+
]);
6364
6465
This sort of portability handling is pretty expensive because all the result
6566
rows and columns have to be looped inside PHP before being returned to you.

0 commit comments

Comments
 (0)