-
Notifications
You must be signed in to change notification settings - Fork 383
Open
Description
I have entity answers and I use softdeleted filter for them, and when I remove entity in some action everything fine, I have deletedAt datetime, but when I try remove this entity in OnFlushEvent my entity is gone from DB, why ?
public function onFlush(OnFlushEventArgs $args)
{
$em = $args->getEntityManager();
$uow = $em->getUnitOfWork();
$em->getFilters()->enable('softdeleteable');
foreach ($uow->getScheduledEntityUpdates() as $entity) {
if ($entity instanceof Questions) {
$existAnswers = $this->container->get('app.repository.question_answers')
->findOneBy(['questions' => $entity]);
$em->remove($existAnswers);
}
}
}
entity
* @Gedmo\SoftDeleteable(fieldName="deletedAt")
*/
class QuestionAnswers
I checked, this filter enabled, I try force enable but no helped
Metadata
Metadata
Assignees
Labels
No labels