|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function deleteEntity(EntityManagerInterface $entityManager, $entityInstance): void |
|
|
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(); |
|
|
$entityManager->flush(); |
|
|
$this->get(FlashBagTranslator::class)->add('success', 'deleted', $this->getTranslationEntityName()); |
|
|
$this->get(FlashBagTranslator::class)->add('success', 'deleted', $this->getTranslationEntityName()); |
|
|
} |
|
|
} |