mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-04 12:29:43 +00:00
Replace methods with injected services
This commit is contained in:
@@ -154,7 +154,7 @@ class ApiController extends AbstractCRUDController
|
||||
return $response;
|
||||
}
|
||||
|
||||
$this->getManagerRegistry()->getManagerForClass($this->getEntityClass())->flush();
|
||||
$this->managerRegistry->getManagerForClass($this->getEntityClass())->flush();
|
||||
|
||||
$response = $this->onAfterFlush($action, $request, $_format, $entity, $errors);
|
||||
|
||||
@@ -270,10 +270,10 @@ class ApiController extends AbstractCRUDController
|
||||
}
|
||||
|
||||
if ($forcePersist && Request::METHOD_POST === $request->getMethod()) {
|
||||
$this->getManagerRegistry()->getManager()->persist($postedData);
|
||||
$this->managerRegistry->getManager()->persist($postedData);
|
||||
}
|
||||
|
||||
$this->getManagerRegistry()->getManager()->flush();
|
||||
$this->managerRegistry->getManager()->flush();
|
||||
|
||||
$response = $this->onAfterFlush($action, $request, $_format, $entity, $errors, [$postedData]);
|
||||
|
||||
@@ -404,8 +404,8 @@ class ApiController extends AbstractCRUDController
|
||||
return $response;
|
||||
}
|
||||
|
||||
$this->getManagerRegistry()->getManager()->persist($entity);
|
||||
$this->getManagerRegistry()->getManager()->flush();
|
||||
$this->managerRegistry->getManager()->persist($entity);
|
||||
$this->managerRegistry->getManager()->flush();
|
||||
|
||||
$response = $this->onAfterFlush($action, $request, $_format, $entity, $errors);
|
||||
|
||||
|
Reference in New Issue
Block a user