From: Nicolas Boisselier Date: Mon, 23 May 2016 23:23:52 +0000 (+0100) Subject: rename out2 X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=afdcbe89800522cdcac6c0f08b3e363dedebed26;p=nb.git rename out2 --- diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 5cf1e431..35167ad5 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -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());