From a1c5a358992ed7502febd6ce43efd3f96b7d9f14 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Wed, 17 Sep 2014 13:54:02 +0000 Subject: [PATCH] dblayer : allow the titles to be defined in public variable in plus of a function which can be overloaded git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1828 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- dblayer.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dblayer.php b/dblayer.php index 786e630..4c61235 100644 --- a/dblayer.php +++ b/dblayer.php @@ -61,6 +61,8 @@ class dblayer extends PDO private $dsn = null; /** The field group delimiter */ private $sep = ""; + /** Titles */ + public $titles = array (); // TODO !! /** Create Table creation from $this->fields with engine abstraction @@ -784,8 +786,16 @@ class dblayer extends PDO if (count ($this->fields) === 0) throw new Exception (dgettext("domframework", "No Field defined"), 500); $arr = array (); - foreach ($this->fields as $field=>$v) - $arr[$field] = $field; + if (count ($this->titles) !== 0) + { + foreach ($this->titles as $field=>$v) + $arr[$field] = $field; + } + else + { + foreach ($this->fields as $field=>$v) + $arr[$field] = $field; + } return $arr; }