This commit is contained in:
parent
91988123a0
commit
d444bd9a61
@ -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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user