public function getDatabase($name = null)
    {
        if (empty($name)) {
            $name = $this->getCurrentDatabaseName();
        }

        if (!isset($this->databasePool[$name])) {
            // init db
            $database = new Database($this, $name);
            if (isset($this->mapping[$name])) {
                $database->map($this->mapping[$name]);
            }

            // configure db
            $this->databasePool[$name] = $database;
        }
        
        return $this->databasePool[$name];
    }
public function getDatabase($name = null)
    {
        if (empty($name)) {
            $name = $this->getCurrentDatabaseName();
        }

        if (!isset($this->databasePool[$name])) {
            // init db
            $database = new Database($this, $name);
            if (isset($this->mapping[$name])) {
                $database->map($this->mapping[$name]);
            }

            // configure db
            $this->databasePool[$name] = $database;
        }
        
        return $this->databasePool[$name];
    }
public function getDatabase ( $ name = null ) { if ( empty ( $ name ) ) { $ name = $ this -> getCurrentDatabaseName ( ) ; } if ( ! isset ( $ this -> databasePool [ $ name ] ) ) { // init db $ database = new Database ( $ this , $ name ) ; if ( isset ( $ this -> mapping [ $ name ] ) ) { $ database -> map ( $ this -> mapping [ $ name ] ) ; } // configure db $ this -> databasePool [ $ name ] = $ database ; } return $ this -> databasePool [ $ name ] ; }
Get database instance

@param string $name database name

@return Database

@throws Exception
Get database instance