瀏覽代碼

Correctif suppression

develop
Fabien Normand 3 年之前
父節點
當前提交
a33c71d07c
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. +6
    -1
      Controller/AbstractAdminController.php

+ 6
- 1
Controller/AbstractAdminController.php 查看文件

@@ -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…
取消
儲存