mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
Set requestor for accompanying period
This commit is contained in:
@@ -25,12 +25,19 @@ class AbstractCRUDController extends AbstractController
|
||||
*
|
||||
* @param string $id
|
||||
* @return object
|
||||
* @throw Symfony\Component\HttpKernel\Exception\NotFoundHttpException if the object is not found
|
||||
*/
|
||||
protected function getEntity($action, $id, Request $request): ?object
|
||||
protected function getEntity($action, $id, Request $request): object
|
||||
{
|
||||
return $this->getDoctrine()
|
||||
$e = $this->getDoctrine()
|
||||
->getRepository($this->getEntityClass())
|
||||
->find($id);
|
||||
|
||||
if (NULL === $e) {
|
||||
throw $this->createNotFoundException(sprintf("The object %s for id %s is not found", $this->getEntityClass(), $id));
|
||||
}
|
||||
|
||||
return $e;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user