diff --git a/etemplate/inc/class.so_sql.inc.php b/etemplate/inc/class.so_sql.inc.php index 401c16cce7..aa64e4f8b6 100644 --- a/etemplate/inc/class.so_sql.inc.php +++ b/etemplate/inc/class.so_sql.inc.php @@ -656,9 +656,9 @@ class so_sql /** * deletes row representing keys in internal data or the supplied $keys if != null * - * @param array $keys=null if given array with col => value pairs to characterise the rows to delete + * @param array|int $keys=null if given array with col => value pairs to characterise the rows to delete, or integer autoinc id * @param boolean $only_return_query=false return $query of delete call to db object, but not run it (used by so_sql_cf!) - * @return int affected rows, should be 1 if ok, 0 if an error + * @return int|array affected rows, should be 1 if ok, 0 if an error or array with id's if $only_return_ids */ function delete($keys=null,$only_return_query=false) { diff --git a/etemplate/inc/class.so_sql_cf.inc.php b/etemplate/inc/class.so_sql_cf.inc.php index 4b19fc6604..1c198a38bd 100644 --- a/etemplate/inc/class.so_sql_cf.inc.php +++ b/etemplate/inc/class.so_sql_cf.inc.php @@ -312,9 +312,9 @@ class so_sql_cf extends so_sql * * reimplented to also delete the custom fields * - * @param array $keys if given array with col => value pairs to characterise the rows to delete + * @param array|int $keys=null if given array with col => value pairs to characterise the rows to delete, or integer autoinc id * @param boolean $only_return_ids=false return $ids of delete call to db object, but not run it (can be used by extending classes!) - * @return int affected rows, should be 1 if ok, 0 if an error + * @return int|array affected rows, should be 1 if ok, 0 if an error or array with id's if $only_return_ids */ function delete($keys=null,$only_return_ids=false) { @@ -332,7 +332,7 @@ class so_sql_cf extends so_sql } else { - $ids = $query[$this->autoinc_id]; + $ids = (array)$query[$this->autoinc_id]; } if ($only_return_ids) return $ids; $this->db->delete($this->extra_table,array($this->extra_id => $ids),__LINE__,__FILE__);