2008-09-12 12:51:56 +04:00
|
|
|
<?php
|
2009-01-22 22:38:10 +03:00
|
|
|
|
|
|
|
namespace Doctrine\DBAL;
|
|
|
|
|
2008-09-12 12:51:56 +04:00
|
|
|
/**
|
|
|
|
* Driver interface.
|
|
|
|
* Interface that all DBAL drivers must implement.
|
|
|
|
*
|
|
|
|
* @since 2.0
|
|
|
|
*/
|
2009-01-22 22:38:10 +03:00
|
|
|
interface Driver
|
2008-09-12 12:51:56 +04:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Attempts to create a connection with the database.
|
|
|
|
*
|
|
|
|
* @param array $params All connection parameters passed by the user.
|
|
|
|
* @param string $username The username to use when connecting.
|
|
|
|
* @param string $password The password to use when connecting.
|
|
|
|
* @param array $driverOptions The driver options to use when connecting.
|
|
|
|
* @return Doctrine::DBAL::Connection The database connection.
|
|
|
|
*/
|
|
|
|
public function connect(array $params, $username = null, $password = null, array $driverOptions = array());
|
2009-02-20 08:46:20 +03:00
|
|
|
|
2008-09-12 12:51:56 +04:00
|
|
|
/**
|
|
|
|
* Gets the DatabasePlatform instance that provides all the metadata about
|
|
|
|
* the platform this driver connects to.
|
|
|
|
*
|
|
|
|
* @return Doctrine::DBAL::DatabasePlatform The database platform.
|
|
|
|
*/
|
|
|
|
public function getDatabasePlatform();
|
2009-02-20 08:46:20 +03:00
|
|
|
|
2008-09-12 12:51:56 +04:00
|
|
|
/**
|
|
|
|
* Gets the SchemaManager that can be used to inspect and change the underlying
|
|
|
|
* database schema of the platform this driver connects to.
|
|
|
|
*
|
2009-05-28 06:04:51 +04:00
|
|
|
* @param Doctrine\DBAL\Connection $conn
|
2009-01-12 16:34:41 +03:00
|
|
|
* @return Doctrine\DBAL\SchemaManager
|
2008-09-12 12:51:56 +04:00
|
|
|
*/
|
2009-01-22 22:38:10 +03:00
|
|
|
public function getSchemaManager(Connection $conn);
|
2009-05-27 22:54:40 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the name of the driver
|
|
|
|
*
|
|
|
|
* @return string The name of the driver
|
|
|
|
*/
|
|
|
|
public function getName();
|
2009-05-28 06:04:51 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the name of the database connected to for this driver instance
|
|
|
|
*
|
|
|
|
* @param Doctrine\DBAL\Connection $conn
|
|
|
|
* @return string $database
|
|
|
|
*/
|
|
|
|
public function getDatabase(\Doctrine\DBAL\Connection $conn);
|
2009-02-20 08:46:20 +03:00
|
|
|
}
|