Mark V
1: <?php
2: namespace MOC\V\Component\Database\Component;
3:
4: use Doctrine\DBAL\Connection;
5: use Doctrine\DBAL\Query\QueryBuilder;
6: use Doctrine\DBAL\Schema\AbstractSchemaManager;
7: use MOC\V\Component\Database\Component\Exception\Repository\NoConnectionException;
8: use MOC\V\Component\Database\Component\Parameter\Repository\DatabaseParameter;
9: use MOC\V\Component\Database\Component\Parameter\Repository\DriverParameter;
10: use MOC\V\Component\Database\Component\Parameter\Repository\HostParameter;
11: use MOC\V\Component\Database\Component\Parameter\Repository\PasswordParameter;
12: use MOC\V\Component\Database\Component\Parameter\Repository\PortParameter;
13: use MOC\V\Component\Database\Component\Parameter\Repository\UsernameParameter;
14:
15: /**
16: * Interface IBridgeInterface
17: *
18: * @package MOC\V\Component\Database\Component
19: */
20: interface IBridgeInterface
21: {
22:
23: /**
24: * @param UsernameParameter $Username
25: * @param PasswordParameter $Password
26: * @param DatabaseParameter $Database
27: * @param DriverParameter $Driver
28: * @param HostParameter $Host
29: * @param PortParameter $Port
30: * @param int $Timeout
31: *
32: * @return IBridgeInterface
33: */
34: public function registerConnection(
35: UsernameParameter $Username,
36: PasswordParameter $Password,
37: DatabaseParameter $Database,
38: DriverParameter $Driver,
39: HostParameter $Host,
40: PortParameter $Port,
41: $Timeout = 5
42: );
43:
44: /**
45: * Example: SELECT * FROM example WHERE id = ? AND name = ?
46: *
47: * @param string $Sql
48: *
49: * @return IBridgeInterface
50: */
51: public function prepareStatement($Sql);
52:
53: /**
54: * @param mixed $Value
55: * @param null|int $Type
56: *
57: * @return IBridgeInterface
58: */
59: public function defineParameter($Value, $Type = null);
60:
61: /**
62: * @return array
63: */
64: public function executeRead();
65:
66: /**
67: * @return int
68: */
69: public function executeWrite();
70:
71: /**
72: * WARNING: this may drop out with no replacement
73: *
74: * @return AbstractSchemaManager
75: * @throws NoConnectionException
76: */
77: public function getSchemaManager();
78:
79: /**
80: * WARNING: this may drop out with no replacement
81: *
82: * @return QueryBuilder
83: * @throws NoConnectionException
84: */
85: public function getQueryBuilder();
86:
87: /**
88: * WARNING: this may drop out with no replacement
89: *
90: * @return Connection
91: * @throws NoConnectionException
92: */
93: public function getConnection();
94: }
95: