projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0b0ae04
)
DatabaseColumns.php
author
Alan Knowles
<alan@roojs.com>
Thu, 12 Jun 2014 06:16:49 +0000
(14:16 +0800)
committer
Alan Knowles
<alan@roojs.com>
Thu, 12 Jun 2014 06:16:49 +0000
(14:16 +0800)
DatabaseColumns.php
patch
|
blob
|
history
diff --git
a/DatabaseColumns.php
b/DatabaseColumns.php
index
d2e14e6
..
4eae818
100644
(file)
--- a/
DatabaseColumns.php
+++ b/
DatabaseColumns.php
@@
-29,19
+29,24
@@
class Pman_Core_DatabaseColumns extends Pman {
} else {
$re = $d->autoJoin();
} else {
$re = $d->autoJoin();
- echo '<PRE>';print_r($re);
+
//
echo '<PRE>';print_r($re);
$cols = $re['cols'] ;
$cols = $re['cols'] ;
- $types =
$d->table
();
-
print_r($types);exit
;
+ $types =
array
();
+
$schemas = array($table => $d->table())
;
- $schemas = array();
-
- foreach($re['join_names'] as $c=>$f) {
-
+ foreach($cols as $name=>$table_col) {
+ list($tbl, $col) = explode('.', $table_col);
+ if (!isset($schemas[$tbl])) {
+ $schemas[$tbl] = DB_DataObject::Factory($tbl)->table();
+ }
+ $types[$name] = $schemas[$tbl][$table_col];
+ }
+
+ foreach($re['join_names'] as $c=>$f) {
$cols[$c] = $f;
}
$cols[$c] = $f;
}
@@
-52,7
+57,8
@@
class Pman_Core_DatabaseColumns extends Pman {
foreach($cols as $c=>$f) {
$ret[] = array(
'name' => $c,
foreach($cols as $c=>$f) {
$ret[] = array(
'name' => $c,
- 'val' => $f
+ 'val' => $f,
+ 'type' => isset($types[$c]) ? $types[$c] : -1,
);
}
);
}