dblayeroo: display the titles with the table name if the funll option is set or if a joinObject is defined
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3572 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -1013,7 +1013,7 @@ class dblayeroo
|
||||
|
||||
/** Get all the fields with the table name if needed.
|
||||
* If the objectJoin is set, return the fields name too
|
||||
* @param boolean $full Add the table name if the $full is set
|
||||
* @param boolean|null $full Add the table name if the $full is set
|
||||
*/
|
||||
public function fieldsAll ($full = false)
|
||||
/* {{{ */
|
||||
@@ -1185,13 +1185,30 @@ class dblayeroo
|
||||
|
||||
/** Get/Set the titles property
|
||||
* @param array|null $titles The titles of the fields
|
||||
* @param boolean|null $full Add the table name if the $full is set
|
||||
*/
|
||||
public function titles ($titles=null)
|
||||
public function titles ($titles=null, $full = false)
|
||||
/* {{{ */
|
||||
{
|
||||
$this->debugLog ("Entering titles (VALUE)");
|
||||
if ($titles === null)
|
||||
return $this->titles;
|
||||
{
|
||||
if ($full === false && $this->joinObject === null)
|
||||
return $this->titles;
|
||||
$titles = array ();
|
||||
foreach ($this->titles as $key=>$val)
|
||||
{
|
||||
$titles[$this->tableprefix.$this->table.".".$key] = $val;
|
||||
}
|
||||
if ($this->joinObject !== null)
|
||||
{
|
||||
foreach ($this->joinObject as $obj)
|
||||
{
|
||||
$titles = array_merge ($titles, $obj->titles (null, true));
|
||||
}
|
||||
}
|
||||
return $titles;
|
||||
}
|
||||
if (! is_array ($titles))
|
||||
$this->DBException ("Parameter titles invalid: not an array");
|
||||
foreach ($titles as $title=>$translation)
|
||||
|
||||
Reference in New Issue
Block a user