Browse Source

Correctif suppression

develop
Fabien Normand 3 years ago
parent
commit
a33c71d07c
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      Controller/AbstractAdminController.php

+ 6
- 1
Controller/AbstractAdminController.php View File

@@ -466,7 +466,12 @@ abstract class AbstractAdminController extends EaAbstractCrudController

public function deleteEntity(EntityManagerInterface $entityManager, $entityInstance): void
{
$entityManager->delete($entityInstance);
if($this->isInstanceOf(StatusInterface::class)){
$entityInstance->setStatus(-1);
$entityManager->update($entityInstance);
}else{
$entityManager->delete($entityInstance);
}
$entityManager->flush();
$this->get(FlashBagTranslator::class)->add('success', 'deleted', $this->getTranslationEntityName());
}

Loading…
Cancel
Save