-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathConnection.php
More file actions
53 lines (46 loc) · 1.02 KB
/
Connection.php
File metadata and controls
53 lines (46 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace Darya\Database;
use Darya\Storage\Query as StorageQuery;
/**
* Darya's database connection interface.
*
* @author Chris Andrew <chris@hexus.io>
*/
interface Connection
{
/**
* Initiate a connection to the database.
*/
public function connect();
/**
* Determine whether there is an active connection to the database.
*
* @return bool
*/
public function connected();
/**
* Close the connection to the database.
*/
public function disconnect();
/**
* Translate a storage query to a database query for this connection.
*
* @param StorageQuery $storageQuery
* @return \Darya\Database\Query
*/
public function translate(StorageQuery $storageQuery);
/**
* Query the database.
*
* @param string $query
* @param array $parameters [optional]
* @return \Darya\Database\Result
*/
public function query($query, array $parameters = array());
/**
* Retrieve any error that occurred with the last operation.
*
* @return \Darya\Database\Error
*/
public function error();
}