1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-12 09:04:24 +02:00

improved reflection skills

This commit is contained in:
David Grudl
2008-10-28 01:03:50 +00:00
parent e221a13dda
commit ab892255d3
15 changed files with 242 additions and 140 deletions

View File

@@ -339,15 +339,18 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
public function getColumnsMeta()
{
$count = mssql_num_fields($this->resultSet);
$meta = array();
$res = array();
for ($i = 0; $i < $count; $i++) {
// items 'name' and 'table' are required
$info = (array) mssql_fetch_field($this->resultSet, $i);
$info['table'] = $info['column_source'];
$info['nativetype'] = $info['type'];
$meta[] = $info;
$row = (array) mssql_fetch_field($this->resultSet, $i);
$res[] = array(
'name' => $row['name'],
'fullname' => $row['column_source'] ? $row['column_source'] . '.' . $row['name'] : $row['name'],
'table' => $row['column_source'],
'type' => NULL,
'nativetype' => $row['type'],
) + $row;
}
return $meta;
return $res;
}