1 | <?php /** ConnectionMicro */ |
||
20 | class Connection implements IConnection |
||
21 | { |
||
22 | /** @var IDriver $driver */ |
||
23 | private $driver; |
||
24 | |||
25 | |||
26 | /** |
||
27 | * Make connection to database with PDO driver |
||
28 | * |
||
29 | * @access public |
||
30 | * |
||
31 | * @param string $dsn DSN connection string |
||
32 | * @param array $config Configuration of connection |
||
33 | * @param array $options Other options |
||
34 | * |
||
35 | * @result void |
||
36 | */ |
||
37 | public function __construct($dsn, array $config = [], array $options = []) |
||
41 | |||
42 | /** |
||
43 | * Get DB driver |
||
44 | * |
||
45 | * @access public |
||
46 | * @return IDriver |
||
47 | */ |
||
48 | public function getDriver() |
||
52 | |||
53 | /** |
||
54 | * Set active connection driver |
||
55 | * |
||
56 | * @access public |
||
57 | * |
||
58 | * @param string $dsn DSN connection string |
||
59 | * @param array $config Configuration of connection |
||
60 | * @param array $options Other options |
||
61 | * |
||
62 | * @return void |
||
63 | * @throws Exception |
||
64 | */ |
||
65 | public function setDriver($dsn, array $config = [], array $options = []) |
||
77 | } |
||
78 |