public static function getConnection($name = null, $mode = Propel::CONNECTION_WRITE)
    {
        if ($name === null) {
            $name = self::getDefaultDB();
        }

        // IF a WRITE-mode connection was requested
        // or Propel is configured to always use the master connection
        // THEN return the master connection.
        if ($mode != Propel::CONNECTION_READ || self::$forceMasterConnection) {
            return self::getMasterConnection($name);
        } else {
            return self::getSlaveConnection($name);
        }
    }
public static function getConnection($name = null, $mode = Propel::CONNECTION_WRITE)
    {
        if ($name === null) {
            $name = self::getDefaultDB();
        }

        // IF a WRITE-mode connection was requested
        // or Propel is configured to always use the master connection
        // THEN return the master connection.
        if ($mode != Propel::CONNECTION_READ || self::$forceMasterConnection) {
            return self::getMasterConnection($name);
        } else {
            return self::getSlaveConnection($name);
        }
    }
public static function getConnection ( $ name = null , $ mode = Propel :: CONNECTION_WRITE ) { if ( $ name === null ) { $ name = self :: getDefaultDB ( ) ; } // IF a WRITE-mode connection was requested // or Propel is configured to always use the master connection // THEN return the master connection. if ( $ mode != Propel :: CONNECTION_READ || self :: $ forceMasterConnection ) { return self :: getMasterConnection ( $ name ) ; } else { return self :: getSlaveConnection ( $ name ) ; } }
Gets an already-opened PDO connection or opens a new one for passed-in db name.

@param string $name The datasource name that is used to look up the DSN from the runtime configuration file.
@param string $mode The connection mode (this applies to replication systems).

@return PDO A database connection

@throws PropelException - if connection cannot be configured or initialized.
Gets an already - opened PDO connection or opens a new one for passed - in db name .