Fixed #587: added 'removeRecord()' method to Doctrine_Table, which is
called in Doctrine_Connection_UnitOfWork->delete().
This commit is contained in:
parent
c6e99ade91
commit
3f3103a195
@ -290,6 +290,8 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
|
||||
$record->getTable()->getRecordListener()->postDelete($event);
|
||||
|
||||
$record->postDelete($event);
|
||||
|
||||
$record->getTable()->removeRecord($record);
|
||||
|
||||
$this->conn->commit();
|
||||
|
||||
|
@ -1049,6 +1049,26 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
||||
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
|
||||
* first checks if record exists in identityMap, if not
|
||||
|
Loading…
Reference in New Issue
Block a user