src/Soluble/DbWrapper/AdapterFactory.php
protected static function getAdapterFromPdo(\PDO $resource)
    {
        $driver = mb_strtolower($resource->getAttribute(\PDO::ATTR_DRIVER_NAME));
        switch ($driver) {
            case 'mysql':
                $adapter = new Adapter\PdoMysqlAdapter($resource);
                break;
            case 'sqlite':
                $adapter = new Adapter\PdoSqliteAdapter($resource);
                break;
            default:
                $msg = "Driver 'PDO_$driver' is not currently supported.";
                throw new Exception\UnsupportedDriverException($msg);
        }

        return $adapter;
    }
protected static function getAdapterFromPdo(\PDO $resource)
    {
        $driver = mb_strtolower($resource->getAttribute(\PDO::ATTR_DRIVER_NAME));
        switch ($driver) {
            case 'mysql':
                $adapter = new Adapter\PdoMysqlAdapter($resource);
                break;
            case 'sqlite':
                $adapter = new Adapter\PdoSqliteAdapter($resource);
                break;
            default:
                $msg = "Driver 'PDO_$driver' is not currently supported.";
                throw new Exception\UnsupportedDriverException($msg);
        }

        return $adapter;
    }
protected static function getAdapterFromPdo ( \ PDO $ resource ) { $ driver = mb_strtolower ( $ resource -> getAttribute ( \ PDO :: ATTR_DRIVER_NAME ) ) ; switch ( $ driver ) { case 'mysql' : $ adapter = new Adapter \ PdoMysqlAdapter ( $ resource ) ; break ; case 'sqlite' : $ adapter = new Adapter \ PdoSqliteAdapter ( $ resource ) ; break ; default : $ msg = "Driver 'PDO_$driver' is not currently supported." ; throw new Exception \ UnsupportedDriverException ( $ msg ) ; } return $ adapter ; }
Get an adapter from an existing connection resource.

@param \PDO $resource database connection object

@throws Exception\UnsupportedDriverException

@return Adapter\AdapterInterface
Get an adapter from an existing connection resource .