public function scheduleForUpdate($entity)
{
$oid = spl_object_hash($entity);
if ( ! isset($this->entityIdentifiers[$oid])) {
throw new InvalidArgumentException("Entity has no identity.");
}
if (isset($this->entityDeletions[$oid])) {
throw new InvalidArgumentException("Entity is removed.");
}
if ( ! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) {
$this->entityUpdates[$oid] = $entity;
}
}