diff --git a/include/lib/noalyss_sql.class.php b/include/lib/noalyss_sql.class.php index 1eb466d3b..25edb2f57 100644 --- a/include/lib/noalyss_sql.class.php +++ b/include/lib/noalyss_sql.class.php @@ -312,16 +312,17 @@ abstract class Noalyss_SQL extends Data_SQL return $this; } /** - * Turn an object (row) into an array + * Turn an object (row) into an array, and the key could be prefixed with $prefix + * @param string $prefix before the key * @return array */ - public function to_array() + public function to_array($prefix="") { $array=array(); foreach ($this->name as $key=> $value) { - - $array[$key]=$this->$key; + $nkey=$prefix.$key; + $array[$nkey]=$this->$key; } return $array; }