Driver.php 958 Bytes
Newer Older
1 2
<?php

3 4 5
namespace Doctrine\DBAL\Driver\PDOPgSql;

use Doctrine\DBAL\Platforms;
6 7 8 9 10 11

/**
 * Driver that connects through pdo_pgsql.
 *
 * @since 2.0
 */
12
class Driver implements \Doctrine\DBAL\Driver
13 14 15
{
    public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
    {
16 17 18 19 20 21
        return new \Doctrine\DBAL\Driver\PDOConnection(
            $this->_constructPdoDsn($params),
            $username,
            $password,
            $driverOptions
        );
22
    }
23

24 25 26 27 28 29 30 31 32
    /**
     * Constructs the Postgres PDO DSN.
     *
     * @return string  The DSN.
     */
    private function _constructPdoDsn(array $params)
    {
        //TODO
    }
33

34 35
    public function getDatabasePlatform()
    {
36
        return new \Doctrine\DBAL\Platforms\PostgreSqlPlatform();
37
    }
38 39

    public function getSchemaManager(\Doctrine\DBAL\Connection $conn)
40
    {
41
        return new \Doctrine\DBAL\Schema\PostgreSqlSchemaManager($conn);
42
    }
43
}