3 require_once 'Pman.php';
5 class Pman_Core_DatabaseColumns extends Pman {
10 parent::getAuth(); // load company!
11 $au = $this->getAuthUser();
14 $this->jerr("Not authenticated", array('authFailure' => true));
16 if (!$au->pid() ) { // not set up yet..
17 $this->jerr("Not authenticated", array('authFailure' => true));
21 $this->authUser = $au;
25 function get($table) {
26 $d = DB_DAtaObject::Factory($table);
27 if (method_exists($d, 'availableColumns')) {
28 $cols = $d->availableColumns();
32 //echo '<PRE>';print_r($re);
37 $schemas = array($table => $d->table());
39 foreach($cols as $name=>$table_col) {
40 list($tbl, $col) = explode('.', $table_col);
41 if (!isset($schemas[$tbl])) {
42 $schemas[$tbl] = DB_DataObject::Factory($tbl)->table();
44 $types[$name] = $schemas[$tbl][$table_col];
49 foreach($re['join_names'] as $c=>$f) {
57 foreach($cols as $c=>$f) {
61 'type' => isset($types[$c]) ? $types[$c] : -1,