Skip to content

Conversation

dmnbars
Copy link

@dmnbars dmnbars commented Nov 1, 2021

adapter for doctrine dbal version 3.0 and above.
this adapter is copy of Phpmig\Adapter\Doctrine\DBAL with fixed Connection methods calls.
more info about changes in version 3 here: https://www.doctrine-project.org/2020/11/17/dbal-3.0.0.html

@dmnbars
Copy link
Author

dmnbars commented Nov 2, 2021

or we can use one class (Phpmig\Adapter\Doctrine\DBAL) and statements like this:

if (\method_exists($this->connection, 'fetchAllAssociative')) {
    $all = $this->connection->fetchAllAssociative($sql);
} else {
    $all = $this->connection->fetchAll($sql);
}

and

if (\method_exists($this->connection, 'executeQuery')) {
    $this->connection->executeQuery($sql);
} else {
    $this->connection->query($sql);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant