src/Arvici/Heart/Database/Driver/PDOConnection.php
public function getDbalConnection()
    {
        $dbalDriver = '';
        $driverCode = $this->getDriver()->getCode();

        if ($driverCode === 'MySQL') $dbalDriver = 'pdo_mysql';
        if ($dbalDriver == '') return null;

        $config = new Configuration();
        $loggerChain = new LoggerChain();

        if (\Arvici\Heart\Config\Configuration::get('app.env') == 'development') {
            $loggerChain->addLogger(new DoctrineLogBridge(\Logger::getInstance()->getMonologInstance()));
            $loggerChain->addLogger(DebugBarHelper::getInstance()->getDebugStack());
        }
        $config->setSQLLogger($loggerChain);

        return DriverManager::getConnection([
            'driver' => $dbalDriver,
            'pdo' => $this
        ], $config);
    }
public function getDbalConnection()
    {
        $dbalDriver = '';
        $driverCode = $this->getDriver()->getCode();

        if ($driverCode === 'MySQL') $dbalDriver = 'pdo_mysql';
        if ($dbalDriver == '') return null;

        $config = new Configuration();
        $loggerChain = new LoggerChain();

        if (\Arvici\Heart\Config\Configuration::get('app.env') == 'development') {
            $loggerChain->addLogger(new DoctrineLogBridge(\Logger::getInstance()->getMonologInstance()));
            $loggerChain->addLogger(DebugBarHelper::getInstance()->getDebugStack());
        }
        $config->setSQLLogger($loggerChain);

        return DriverManager::getConnection([
            'driver' => $dbalDriver,
            'pdo' => $this
        ], $config);
    }
public function getDbalConnection ( ) { $ dbalDriver = '' ; $ driverCode = $ this -> getDriver ( ) -> getCode ( ) ; if ( $ driverCode === 'MySQL' ) $ dbalDriver = 'pdo_mysql' ; if ( $ dbalDriver == '' ) return null ; $ config = new Configuration ( ) ; $ loggerChain = new LoggerChain ( ) ; if ( \ Arvici \ Heart \ Config \ Configuration :: get ( 'app.env' ) == 'development' ) { $ loggerChain -> addLogger ( new DoctrineLogBridge ( \ Logger :: getInstance ( ) -> getMonologInstance ( ) ) ) ; $ loggerChain -> addLogger ( DebugBarHelper :: getInstance ( ) -> getDebugStack ( ) ) ; } $ config -> setSQLLogger ( $ loggerChain ) ; return DriverManager :: getConnection ( [ 'driver' => $ dbalDriver , 'pdo' => $ this ] , $ config ) ; }
Get DBAL Connection

@return \Doctrine\DBAL\Connection
Get DBAL Connection