1 | <?php |
||
16 | class SQLiteDriver extends AbstractDriver implements DriverInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $columns = []; |
||
22 | |||
23 | /** |
||
24 | * @var \PDO |
||
25 | */ |
||
26 | protected $pdo; |
||
27 | |||
28 | /** |
||
29 | * @param PDO $pdo |
||
30 | */ |
||
31 | 24 | public function __construct(\PDO $pdo) |
|
35 | |||
36 | /** |
||
37 | * Returns a listing of columns from the specified table. |
||
38 | * |
||
39 | * @param string $tableName |
||
40 | * @return array |
||
41 | * @throws \Rougin\Describe\Exceptions\TableNameNotFoundException |
||
42 | */ |
||
43 | 18 | public function getColumns($tableName) |
|
47 | |||
48 | /** |
||
49 | * Returns a listing of columns from the specified table. |
||
50 | * NOTE: To be removed in v2.0.0. |
||
51 | * |
||
52 | * @param string $tableName |
||
53 | * @return array |
||
54 | * @throws \Rougin\Describe\Exceptions\TableNameNotFoundException |
||
55 | */ |
||
56 | 18 | public function getTable($tableName) |
|
60 | |||
61 | /** |
||
62 | * Returns a listing of tables from the specified database. |
||
63 | * |
||
64 | * @return array |
||
65 | */ |
||
66 | 6 | public function getTableNames() |
|
70 | |||
71 | /** |
||
72 | * Shows the list of tables. |
||
73 | * NOTE: To be removed in v2.0.0. |
||
74 | * |
||
75 | * @return array |
||
76 | */ |
||
77 | 6 | public function showTables() |
|
94 | |||
95 | /** |
||
96 | * Prepares the defined columns. |
||
97 | * |
||
98 | * @param string $tableName |
||
99 | * @param mixed $row |
||
100 | * @return \Rougin\Describe\Column |
||
101 | */ |
||
102 | 15 | protected function setColumn($tableName, $row) |
|
115 | |||
116 | /** |
||
117 | * Sets the properties of the specified column if it does exists. |
||
118 | * |
||
119 | * @param string $tableName |
||
120 | * @param \Rougin\Describe\Column $column |
||
121 | * @return \Rougin\Describe\Column |
||
122 | */ |
||
123 | 15 | protected function setForeignColumn($tableName, Column $column) |
|
141 | |||
142 | /** |
||
143 | * Sets the properties of the specified column. |
||
144 | * |
||
145 | * @param mixed $row |
||
146 | * @param \Rougin\Describe\Column $column |
||
147 | * @return void |
||
148 | */ |
||
149 | 15 | protected function setProperties($row, Column $column) |
|
162 | } |
||
163 |