public function remove($entity)
{
if ($this->evm->hasListeners(Events::preRemove)) {
$this->evm->dispatchEvent(Events::preRemove, new Event\LifecycleEventArgs($entity, $this->sm));
}
$oid = spl_object_hash($entity);
$this->scheduledForDelete[$oid] = $entity;
if ($this->evm->hasListeners(Events::postRemove)) {
$this->evm->dispatchEvent(Events::postRemove, new Event\LifecycleEventArgs($entity, $this->sm));
}
}