1 | <?php /** ConnectionMicro */ |
||
20 | class Connection implements Adapter |
||
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 | * @throws Exception |
||
37 | */ |
||
38 | public function __construct($dsn, array $config = [], array $options = []) |
||
42 | |||
43 | /** |
||
44 | * Get DB driver |
||
45 | * |
||
46 | * @access public |
||
47 | * @return IDriver |
||
48 | */ |
||
49 | public function getDriver() |
||
53 | |||
54 | /** |
||
55 | * Set active connection driver |
||
56 | * |
||
57 | * @access public |
||
58 | * |
||
59 | * @param string $dsn DSN connection string |
||
60 | * @param array $config Configuration of connection |
||
61 | * @param array $options Other options |
||
62 | * |
||
63 | * @return void |
||
64 | * @throws Exception |
||
65 | */ |
||
66 | public function setDriver($dsn, array $config = [], array $options = []) |
||
78 | } |
||
79 |