Open dmnbars opened 2 years ago
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);
}
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