1
0
mirror of synced 2024-12-05 03:06:05 +03:00
This commit is contained in:
doctrine 2006-04-16 22:27:01 +00:00
parent 91988123a0
commit d444bd9a61

View File

@ -98,11 +98,12 @@ class Doctrine_Collection_Batch extends Doctrine_Collection {
$c = count($a);
$pk = $this->table->getPrimaryKeys();
$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 .= ($c > 1)?")":"";
$query .= " ORDER BY id ASC";
$query .= ($c > 1)?") ORDER BY ".$pk[0]." ASC":"";
$stmt = $this->table->getSession()->execute($query,array_values($a));