1
0
mirror of synced 2025-01-31 20:41:44 +03:00
This commit is contained in:
zYne 2007-04-11 18:44:23 +00:00
parent b373cb8ef7
commit 907156fd02

View File

@ -127,15 +127,21 @@ class Doctrine_Transaction extends Doctrine_Connection_Module
foreach ($this->delete as $name => $deletes) { foreach ($this->delete as $name => $deletes) {
$record = false; $record = false;
$ids = array(); $ids = array();
if (is_array($deletes[count($deletes)-1]->getTable()->getIdentifier())) { if (is_array($deletes[count($deletes)-1]->getTable()->getIdentifier())) {
foreach($deletes as $k => $record) { foreach($deletes as $k => $record) {
$cond = ''; $cond = '';
$ids = $record->obtainIdentifier(); $ids = $record->obtainIdentifier();
$query = 'DELETE FROM '.$record->getTable()->getTableName().' WHERE '; $query = 'DELETE FROM '.$record->getTable()->getTableName().' WHERE ';
foreach(array_keys($ids) as $id ){ foreach(array_keys($ids) as $id ){
if ($cond){ $cond .= " AND ";} if ($cond) {
$cond .= " AND ";
}
$cond .= " $id = ? "; $cond .= " $id = ? ";
} }
$query = $query . $cond; $query = $query . $cond;
$this->conn->execute($query, array_values($ids)); $this->conn->execute($query, array_values($ids));
} }