Inject ManagerRegistry directly instead of getting from container

This commit is contained in:
2025-05-27 15:19:15 +02:00
parent c08c909545
commit d9ce4e3ec6
4 changed files with 20 additions and 27 deletions

View File

@@ -80,8 +80,8 @@ class ApiController extends AbstractCRUDController
return $response;
}
$this->getManagerRegistry()->getManager()->remove($entity);
$this->getManagerRegistry()->getManager()->flush();
$this->doctrine->getManager()->remove($entity);
$this->doctrine->getManager()->flush();
$response = $this->onAfterFlush($action, $request, $_format, $entity, $errors);