This commit is contained in:
parent
b373cb8ef7
commit
907156fd02
@ -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));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user