Jira issue originally created by user mounte:
Is there any possibility to extend the Doctrine\DBAL\Driver\Connection class?
Something like this:
public function fetchKeyValue($statement, array $params = array())
return $this->executeQuery($statement, $params)->fetchAll(PDO::FETCHKEYPAIR);
Or is there a solution to get the output of the function above with the existing methods?
Thanks for your support,
Comment created by @deeky666:
Are you sure the fetch mode PDO::FETCHKEYPAIR exists? I can find it in the docs and have never seen it either to be honest. But basically of course it is possible to extend \Doctrine\DBAL\Connection. Just subclass it and override/extend the methods you need.
I think for your purpose it would be enough to use Connection::fetchAll(). You can set your preferred fetch style via Connection::setFetchMode(). Otherwise methods like Connection::fetchAll() will use the default fetch style which is PDO::FETCH_ASSOC.
This is not an issue. I provided you the information you need to achieve what you need and close this ticket for now. If I missed something and this is really an issue, feel free to reopen :)
Issue was closed with resolution "Invalid"