]> git.nbdom.net Git - nb.git/commitdiff
rename out2
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 23 May 2016 23:23:52 +0000 (00:23 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 23 May 2016 23:23:52 +0000 (00:23 +0100)
lib/php/db/table.php

index 5cf1e431c53f832adfd4b4826882e47970639ad8..35167ad50d9041dff9e017a80e2855fb03c2e694 100644 (file)
@@ -1248,8 +1248,7 @@ Class Table extends nb {
 # NB 05.04.16     return $this->db()->exec($sql)->fetchColumn();
   }
 
-# NB 01.04.16   public function out($v,$head=false) { return $this->db()->out($v,$head); }
-  public function out2($v,$head=array()) { return $this->db()->out2($v,$head); }
+  public function out($v,$head=array()) { return $this->db()->out($v,$head); }
 
   public function infos() {
     return 
@@ -1278,18 +1277,23 @@ Class Table extends nb {
 
   public function action($action=null) {
     if ($action === null) $action = $this->p('action');
+# NB 23.05.16     $aliases = function($search) {
+# NB 23.05.16       foreach ([
+# NB 23.05.16         [ 'table.fields', 'fields' ],
+# NB 23.05.16       ] as $k=>$v) {
+# NB 23.05.16         if ($k === $search or $v === $search) return $k;
+# NB 23.05.16       }
+# NB 23.05.16     };
 
     if ($action == 'table.fields' or $action == 'fields') {
-      #return $this->out2(var_export(($this->fields()),true));
-      #return $this->out2(serialize(($this->fields())));
-      return $this->out2(array_values($this->object2array($this->fields())));
+      return $this->out(array_values($this->object2array($this->fields())));
 
     } elseif ($action == 'table.rows' or $action == 'rows') {
       $this->db()->print_header($this->p('format'));
       $this->rows(); return true;
 
     } elseif ($action == 'table.info') {
-      return $this->out2($this->info());
+      return $this->out($this->info());
 
     } elseif ($action == 'table.delete' or $action == 'delete') {
       if (!$this->delete($this->p(),$e)) bye($e);
@@ -1299,14 +1303,14 @@ Class Table extends nb {
     } elseif ($action == 'table.insert' or $action == 'insert') {
       if (!$this->insert($this->p(),$e)) bye($e);
       header('Location: '.$this->url_referer());
-      $this->out2($e);
+      $this->out($e);
       return true;
 
     } elseif ($action == 'table.update' or $action == 'update') {
       #$this->bye($this->p());
       if (!$this->update($this->p(),$e)) bye($e);
       header('Location: '.$this->url_referer());
-      $this->out2($e);
+      $this->out($e);
       return true;
 
     } elseif (self::class_action_out($this,$action)) {
@@ -1514,7 +1518,7 @@ Class Table extends nb {
 
   public function unserialize() {
     $o = unserialize($this->serialize());
-    #return $this->out2($this->fields('id'));
+    #return $this->out($this->fields('id'));
     #return serialize($this->fields());
     #$this = $o;
     #return($o->sql_name());