Commit 3f3103a1 authored by dbrewer's avatar dbrewer

Fixed #587: added 'removeRecord()' method to Doctrine_Table, which is

called in Doctrine_Connection_UnitOfWork->delete().
parent c6e99ade
...@@ -290,6 +290,8 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module ...@@ -290,6 +290,8 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
$record->getTable()->getRecordListener()->postDelete($event); $record->getTable()->getRecordListener()->postDelete($event);
$record->postDelete($event); $record->postDelete($event);
$record->getTable()->removeRecord($record);
$this->conn->commit(); $this->conn->commit();
......
...@@ -1049,6 +1049,26 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable ...@@ -1049,6 +1049,26 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
return true; return true;
} }
/**
* removeRecord
* removes a record from the identity map, returning true if the record
* was found and removed and false if the record wasn't found.
*
* @param Doctrine_Record $record record to be removed
* @return boolean
*/
public function removeRecord(Doctrine_Record $record)
{
$id = implode(' ', $record->identifier());
if (isset($this->_identityMap[$id])) {
unset($this->_identityMap[$id]);
return true;
}
return false;
}
/** /**
* getRecord * getRecord
* first checks if record exists in identityMap, if not * first checks if record exists in identityMap, if not
......
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