diff --git a/dblayeroo.php b/dblayeroo.php index c0055b3..1331f6e 100644 --- a/dblayeroo.php +++ b/dblayeroo.php @@ -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)