]> git.nbdom.net Git - nb.git/commitdiff
fix bug with type
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 30 Aug 2016 11:27:11 +0000 (13:27 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 30 Aug 2016 11:27:11 +0000 (13:27 +0200)
lib/php/db.php
lib/php/db/table.php

index 2bf972f24b7a5d84fabaa79e0bfb4c75a6337ef8..2a72fe18312f8c94b19169e5c39030c6ab928d9d 100644 (file)
@@ -301,6 +301,7 @@ class Db extends nb {
   public static function type($key=null,$die=false,$type=null) {
     global $DB_TYPES;
     if (!$type) $type = self::$type;
+    if ($key == 'type') return $type;
 
     # Load php file
     static $require = array();
index 79fde1c6e0c072f3aad7788cd9b57ff59191f09d..ed5c122e10b3d122c24bc168f72d5777cf7c4d5a 100644 (file)
@@ -633,9 +633,7 @@ Class Table extends nb {
     #return false;
 
     # Test if type exists because of a bug from shell.php
-# NB 30.08.16     if ($this->db()->type) $this->fields();
-    #$db = $this->db();
-    #if ($db::$type) $this->fields();
+# NB 30.08.16     if ($this->db()->type('type')) $this->fields();
 
     foreach ($extras as $k => $v) {
 
@@ -1051,8 +1049,7 @@ Class Table extends nb {
   public function rows_begin_xml() {
     return ''
       .'<?xml version="1.0" encoding="utf-8"?>'.NB_EOL #<?
-      #.'<database name="'.$this->db()->name.'" table="'.$this->name.'" type="'.$this->db()->type.'">'.NB_EOL
-      .'<rows name="'.$this->name.'" database="'.$this->db()->name.'" database-type="'.$this->db()->type.'">'.NB_EOL
+      .'<rows name="'.$this->name.'" database="'.$this->db()->name.'" database-type="'.$this->db()->type('type').'">'.NB_EOL
     ;
   }