phpmig icon indicating copy to clipboard operation
phpmig copied to clipboard

added DBAL3 class for using with doctrine/dbal 3 version

Open dmnbars opened this issue 4 years ago • 1 comments

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 avatar Nov 01 '21 12:11 dmnbars

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);
}

dmnbars avatar Nov 02 '21 12:11 dmnbars