1 | <?php |
||
14 | class DatabaseDriver implements DriverInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $configuration = []; |
||
20 | |||
21 | /** |
||
22 | * @var \Rougin\Describe\Driver\DriverInterface |
||
23 | */ |
||
24 | protected $driver; |
||
25 | |||
26 | /** |
||
27 | * @param string $driverName |
||
28 | * @param array $configuration |
||
29 | */ |
||
30 | 30 | public function __construct($driverName, $configuration = []) |
|
35 | |||
36 | /** |
||
37 | * Gets the specified driver from the specified database connection. |
||
38 | * |
||
39 | * @param string $driverName |
||
40 | * @param array $configuration |
||
41 | * @return \Rougin\Describe\Driver\DriverInterface |
||
42 | * @throws \Rougin\Describe\Exceptions\DatabaseDriverNotFoundException |
||
43 | */ |
||
44 | 30 | protected function getDriver($driverName, $configuration = []) |
|
64 | |||
65 | /** |
||
66 | * Returns a listing of columns from the specified table. |
||
67 | * |
||
68 | * @param string $tableName |
||
69 | * @return array |
||
70 | * @throws \Rougin\Describe\Exceptions\TableNameNotFoundException |
||
71 | */ |
||
72 | 18 | public function getColumns($tableName) |
|
76 | |||
77 | /** |
||
78 | * Returns a listing of columns from the specified table. |
||
79 | * NOTE: To be removed in v2.0.0. |
||
80 | * |
||
81 | * @param string $tableName |
||
82 | * @return array |
||
83 | * @throws \Rougin\Describe\Exceptions\TableNameNotFoundException |
||
84 | */ |
||
85 | 18 | public function getTable($tableName) |
|
89 | |||
90 | /** |
||
91 | * Returns a listing of tables from the specified database. |
||
92 | * |
||
93 | * @return array |
||
94 | */ |
||
95 | 9 | public function getTableNames() |
|
99 | |||
100 | /** |
||
101 | * Shows the list of tables. |
||
102 | * NOTE: To be removed in v2.0.0. |
||
103 | * |
||
104 | * @return array |
||
105 | */ |
||
106 | 9 | public function showTables() |
|
110 | |||
111 | /** |
||
112 | * Parses the configuration into separate variables. |
||
113 | * |
||
114 | * @param array $configuration |
||
115 | * @return array |
||
116 | */ |
||
117 | 30 | protected function parseConfiguration(array $configuration) |
|
132 | } |
||
133 |