Commit d444bd9a authored by doctrine's avatar doctrine

--no commit message

--no commit message
parent 91988123
...@@ -98,11 +98,12 @@ class Doctrine_Collection_Batch extends Doctrine_Collection { ...@@ -98,11 +98,12 @@ class Doctrine_Collection_Batch extends Doctrine_Collection {
$c = count($a); $c = count($a);
$pk = $this->table->getPrimaryKeys();
$query = $this->table->getQuery()." WHERE "; $query = $this->table->getQuery()." WHERE ";
$query .= ($c > 1)?"id IN (":"id = "; $query .= ($c > 1)?$pk[0]." IN (":$pk[0]." = ";
$query .= substr(str_repeat("?, ",count($a)),0,-2); $query .= substr(str_repeat("?, ",count($a)),0,-2);
$query .= ($c > 1)?")":""; $query .= ($c > 1)?") ORDER BY ".$pk[0]." ASC":"";
$query .= " ORDER BY id ASC";
$stmt = $this->table->getSession()->execute($query,array_values($a)); $stmt = $this->table->getSession()->execute($query,array_values($a));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment