You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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 inOnFlushEvent
my entity is gone from DB, why ?entity
I checked, this filter enabled, I try force enable but no helped
The text was updated successfully, but these errors were encountered: