"fix to allow to specify multiple autoinc_id's (as eg. done in timesheet_bo::sum())"

This commit is contained in:
Ralf Becker 2009-08-25 12:48:04 +00:00
parent 46b4c081a1
commit 3a3a0e1613

View File

@ -435,9 +435,10 @@ class so_sql_cf extends so_sql
// replace ambiguous auto-id with (an exact match of) table_name.autoid // replace ambiguous auto-id with (an exact match of) table_name.autoid
if (isset($criteria[$this->autoinc_id])) if (isset($criteria[$this->autoinc_id]))
{ {
if (is_numeric($criteria[$this->autoinc_id])) if ($criteria[$this->autoinc_id])
{ {
$criteria[] = $this->table_name.'.'.$this->autoinc_id.'='.(int)$criteria[$this->autoinc_id]; $criteria[] = $this->db->expression($this->table_name,$this->table_name.'.',
array($this->autoinc_id => $criteria[$this->autoinc_id]));
} }
unset($criteria[$this->autoinc_id]); unset($criteria[$this->autoinc_id]);
} }