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:
14
dblayer.php
14
dblayer.php
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user