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
This commit is contained in:
2014-09-17 13:54:02 +00:00
parent e6b0a396e4
commit a1c5a35899

View File

@@ -61,6 +61,8 @@ class dblayer extends PDO
private $dsn = null; private $dsn = null;
/** The field group delimiter */ /** The field group delimiter */
private $sep = ""; private $sep = "";
/** Titles */
public $titles = array ();
// TODO !! // TODO !!
/** Create Table creation from $this->fields with engine abstraction /** Create Table creation from $this->fields with engine abstraction
@@ -784,8 +786,16 @@ class dblayer extends PDO
if (count ($this->fields) === 0) if (count ($this->fields) === 0)
throw new Exception (dgettext("domframework", "No Field defined"), 500); throw new Exception (dgettext("domframework", "No Field defined"), 500);
$arr = array (); $arr = array ();
foreach ($this->fields as $field=>$v) if (count ($this->titles) !== 0)
$arr[$field] = $field; {
foreach ($this->titles as $field=>$v)
$arr[$field] = $field;
}
else
{
foreach ($this->fields as $field=>$v)
$arr[$field] = $field;
}
return $arr; return $arr;
} }