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 | protected $mysql = array('mysql', 'mysqli'); |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
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 | 33 | public function __construct($name, $data = array()) |
|
49 | |||
50 | /** |
||
51 | * Returns an array of Column instances from a table. |
||
52 | * |
||
53 | * @param string $table |
||
54 | * @return \Rougin\Describe\Column[] |
||
55 | */ |
||
56 | 42 | public function columns($table) |
|
60 | |||
61 | /** |
||
62 | * 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 | 18 | public function getColumns($table) |
|
72 | |||
73 | /** |
||
74 | * 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 | 6 | public function getTable($table) |
|
84 | |||
85 | /** |
||
86 | * Returns an array of table names. |
||
87 | * NOTE: To be removed in v2.0.0. Use tables() instead. |
||
88 | * |
||
89 | * @return array |
||
90 | */ |
||
91 | 12 | public function getTableNames() |
|
95 | |||
96 | /** |
||
97 | * Returns an array of table names. |
||
98 | * NOTE: To be removed in v2.0.0. Use getTableNames() instead. |
||
99 | * |
||
100 | * @return array |
||
101 | */ |
||
102 | 6 | public function showTables() |
|
106 | |||
107 | /** |
||
108 | * Returns an array of Table instances. |
||
109 | * |
||
110 | * @return \Rougin\Describe\Table[] |
||
111 | */ |
||
112 | 18 | public function tables() |
|
116 | |||
117 | /** |
||
118 | * Returns the Driver instance from the configuration. |
||
119 | * |
||
120 | * @param string $name |
||
121 | * @param array $data |
||
122 | * @return \Rougin\Describe\Driver\DriverInterface |
||
123 | * |
||
124 | * @throws \Rougin\Describe\Exceptions\DriverNotFoundException |
||
125 | */ |
||
126 | 63 | protected function driver($name, $data = array()) |
|
146 | } |
||
147 |