1 | <?php |
||
15 | class DatabaseDriver implements DriverInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $data = array(); |
||
21 | |||
22 | /** |
||
23 | * @var \Rougin\Describe\Driver\DriverInterface |
||
24 | */ |
||
25 | protected $driver; |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | 30 | protected $mysql = array('mysql', 'mysqli'); |
|
31 | |||
32 | 30 | /** |
|
33 | 30 | * @var array |
|
34 | 27 | */ |
|
35 | protected $sqlite = array('pdo', 'sqlite', 'sqlite3'); |
||
36 | |||
37 | /** |
||
38 | * Initializes the driver instance. |
||
39 | * |
||
40 | * @param string $name |
||
41 | * @param array $data |
||
42 | */ |
||
43 | public function __construct($name, $data = array()) |
||
49 | 30 | ||
50 | /** |
||
51 | 30 | * Returns an array of Column instances from a table. |
|
52 | 15 | * |
|
53 | 15 | * @param string $table |
|
54 | * @return \Rougin\Describe\Column[] |
||
55 | 15 | */ |
|
56 | 15 | public function columns($table) |
|
60 | |||
61 | /** |
||
62 | 3 | * Returns an array of Column instances from a table. |
|
63 | * NOTE: To be removed in v2.0.0. Use columns() instead. |
||
64 | * |
||
65 | * @param string $table |
||
66 | * @return \Rougin\Describe\Column[] |
||
67 | */ |
||
68 | public function getColumns($table) |
||
72 | 18 | ||
73 | /** |
||
74 | 18 | * Returns an array of Column instances from a table. |
|
75 | * NOTE: To be removed in v2.0.0. Use getColumns() instead. |
||
76 | * |
||
77 | * @param string $table |
||
78 | * @return \Rougin\Describe\Column[] |
||
79 | */ |
||
80 | public function getTable($table) |
||
84 | |||
85 | 18 | /** |
|
86 | * Returns an array of table names. |
||
87 | 18 | * NOTE: To be removed in v2.0.0. Use tables() instead. |
|
88 | * |
||
89 | * @return array |
||
90 | */ |
||
91 | public function getTableNames() |
||
95 | 9 | ||
96 | /** |
||
97 | 9 | * Returns an array of table names. |
|
98 | * NOTE: To be removed in v2.0.0. Use getTableNames() instead. |
||
99 | * |
||
100 | * @return array |
||
101 | */ |
||
102 | public function showTables() |
||
106 | 9 | ||
107 | /** |
||
108 | 9 | * Returns an array of Table instances. |
|
109 | * |
||
110 | * @return \Rougin\Describe\Table[] |
||
111 | */ |
||
112 | public function tables() |
||
116 | |||
117 | 30 | /** |
|
118 | * Returns the Driver instance from the configuration. |
||
119 | 30 | * |
|
120 | 30 | * @param string $name |
|
121 | 30 | * @param array $data |
|
122 | 30 | * @return \Rougin\Describe\Driver\DriverInterface |
|
123 | * |
||
124 | 30 | * @throws \Rougin\Describe\Exceptions\DriverNotFoundException |
|
125 | 27 | */ |
|
126 | 27 | protected function driver($name, $data = array()) |
|
146 | } |
||
147 |