public static function resolveConnection() 
    {
        $cls = get_called_class();
        $env = Connection::selectEnvironment();

        if (array_key_exists($cls, self::$_connections) 
            && array_key_exists($env, self::$_connections[$cls])
        ) {
                return self::$_connections[$cls][$env];
        }
        return self::$connection ? self::$connection : Connection::getConnection();
    }