1 | <?php |
||
16 | class MySQLDriver implements DriverInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $columns = []; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $database; |
||
27 | |||
28 | /** |
||
29 | * @var \PDO |
||
30 | */ |
||
31 | protected $pdo; |
||
32 | |||
33 | /** |
||
34 | * @param PDO $pdo |
||
35 | * @param string $database |
||
36 | */ |
||
37 | 57 | public function __construct(\PDO $pdo, $database) |
|
42 | |||
43 | /** |
||
44 | * Returns the result. |
||
45 | * |
||
46 | * @return array |
||
47 | */ |
||
48 | 51 | public function getTable($table) |
|
100 | |||
101 | /** |
||
102 | * Shows the list of tables. |
||
103 | * |
||
104 | * @return array |
||
105 | */ |
||
106 | 6 | public function showTables() |
|
119 | |||
120 | /** |
||
121 | * Sets the key of the specified column. |
||
122 | * |
||
123 | * @param mixed $row |
||
124 | * @param \Rougin\Describe\Column &$column |
||
125 | * @return void |
||
126 | */ |
||
127 | 48 | protected function setKey($row, Column &$column) |
|
146 | |||
147 | /** |
||
148 | * Sets the properties of the specified column. |
||
149 | * |
||
150 | * @param \PDOStatement $foreignTable |
||
151 | * @param mixed $row |
||
152 | * @param \Rougin\Describe\Column &$column |
||
153 | * @return void |
||
154 | */ |
||
155 | 48 | protected function setForeignColumns($foreignTable, $row, Column &$column) |
|
166 | |||
167 | /** |
||
168 | * Sets the properties of the specified column. |
||
169 | * |
||
170 | * @param mixed $row |
||
171 | * @param \Rougin\Describe\Column &$column |
||
172 | * @return void |
||
173 | */ |
||
174 | 48 | protected function setProperties($row, Column &$column) |
|
186 | |||
187 | /** |
||
188 | * Strips the table schema from the table name. |
||
189 | * |
||
190 | * @param string $table |
||
191 | * @return string |
||
192 | */ |
||
193 | 45 | protected function stripTableSchema($table) |
|
197 | } |
||
198 |