public static function getDB($name = null)
    {
        if ($name === null) {
            $name = self::getDefaultDB();
        }

        if (!isset(self::$adapterMap[$name])) {
            if (!isset(self::$configuration['datasources'][$name]['adapter'])) {
                throw new PropelException("Unable to find adapter for datasource [" . $name . "].");
            }
            $db = DBAdapter::factory(self::$configuration['datasources'][$name]['adapter']);
            // register the adapter for this name
            self::$adapterMap[$name] = $db;
        }

        return self::$adapterMap[$name];
    }
public static function getDB($name = null)
    {
        if ($name === null) {
            $name = self::getDefaultDB();
        }

        if (!isset(self::$adapterMap[$name])) {
            if (!isset(self::$configuration['datasources'][$name]['adapter'])) {
                throw new PropelException("Unable to find adapter for datasource [" . $name . "].");
            }
            $db = DBAdapter::factory(self::$configuration['datasources'][$name]['adapter']);
            // register the adapter for this name
            self::$adapterMap[$name] = $db;
        }

        return self::$adapterMap[$name];
    }
public static function getDB ( $ name = null ) { if ( $ name === null ) { $ name = self :: getDefaultDB ( ) ; } if ( ! isset ( self :: $ adapterMap [ $ name ] ) ) { if ( ! isset ( self :: $ configuration [ 'datasources' ] [ $ name ] [ 'adapter' ] ) ) { throw new PropelException ( "Unable to find adapter for datasource [" . $ name . "]." ) ; } $ db = DBAdapter :: factory ( self :: $ configuration [ 'datasources' ] [ $ name ] [ 'adapter' ] ) ; // register the adapter for this name self :: $ adapterMap [ $ name ] = $ db ; } return self :: $ adapterMap [ $ name ] ; }
Returns database adapter for a specific datasource.

@param      string The datasource name.

@return DBAdapter The corresponding database adapter.

@throws PropelException If unable to find DBdapter for specified db.
Returns database adapter for a specific datasource .