public function preRemove(LifecycleEventArgs $eventArgs)
    {
        $entity = $eventArgs->getObject();

        if ($this->objectPersister->handlesObject($entity)) {
            $this->scheduleForDeletion($entity);
        }
    }
public function preRemove(LifecycleEventArgs $eventArgs)
    {
        $entity = $eventArgs->getObject();

        if ($this->objectPersister->handlesObject($entity)) {
            $this->scheduleForDeletion($entity);
        }
    }
public function preRemove ( LifecycleEventArgs $ eventArgs ) { $ entity = $ eventArgs -> getObject ( ) ; if ( $ this -> objectPersister -> handlesObject ( $ entity ) ) { $ this -> scheduleForDeletion ( $ entity ) ; } }
Delete objects preRemove instead of postRemove so that we have access to the id.  Because this is called
preRemove, first check that the entity is managed by Doctrine.

@param LifecycleEventArgs $eventArgs
Delete objects preRemove instead of postRemove so that we have access to the id . Because this is called preRemove first check that the entity is managed by Doctrine .