framework/Data/Common/Mysql/TMysqlMetaData.php 1 location
|
@@ 337-340 (lines=4) @@
|
| 334 |
|
$command->bindValue(':schema', $schemaName); |
| 335 |
|
} |
| 336 |
|
$fkeys = []; |
| 337 |
|
foreach ($command->query() as $col) { |
| 338 |
|
$fkeys[$col['con']]['keys'][$col['col']] = $col['fkcol']; |
| 339 |
|
$fkeys[$col['con']]['table'] = $col['fktable']; |
| 340 |
|
} |
| 341 |
|
return count($fkeys) > 0 ? array_values($fkeys) : $fkeys; |
| 342 |
|
} |
| 343 |
|
|
framework/Data/Common/Sqlite/TSqliteMetaData.php 1 location
|
@@ 175-178 (lines=4) @@
|
| 172 |
|
$sql = "PRAGMA foreign_key_list({$table})"; |
| 173 |
|
$command = $this->getDbConnection()->createCommand($sql); |
| 174 |
|
$fkeys = []; |
| 175 |
|
foreach ($command->query() as $col) { |
| 176 |
|
$fkeys[$col['table']]['keys'][$col['from']] = $col['to']; |
| 177 |
|
$fkeys[$col['table']]['table'] = $col['table']; |
| 178 |
|
} |
| 179 |
|
return count($fkeys) > 0 ? array_values($fkeys) : $fkeys; |
| 180 |
|
} |
| 181 |
|
|