1
0
mirror of synced 2024-12-13 14:56:01 +03:00

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

called in Doctrine_Connection_UnitOfWork->delete().
This commit is contained in:
dbrewer 2007-11-08 22:35:55 +00:00
parent c6e99ade91
commit 3f3103a195
2 changed files with 22 additions and 0 deletions

View File

@ -291,6 +291,8 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
$record->postDelete($event);
$record->getTable()->removeRecord($record);
$this->conn->commit();
return true;

View File

@ -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