public function getConnection()
    {
        // Initiate connection if not exist
        if ($this->connection === null) {
            $this->connection = DriverManager::getConnection($this->dsn);
        }

        return $this->connection;
    }
public function getConnection()
    {
        // Initiate connection if not exist
        if ($this->connection === null) {
            $this->connection = DriverManager::getConnection($this->dsn);
        }

        return $this->connection;
    }
public function getConnection ( ) { // Initiate connection if not exist if ( $ this -> connection === null ) { $ this -> connection = DriverManager :: getConnection ( $ this -> dsn ) ; } return $ this -> connection ; }
Get connection or create a new connection

@return Connection

@throws DBALException
Get connection or create a new connection