fix how to get task repository

This commit is contained in:
2021-02-12 16:45:24 +01:00
parent 31e1a40cb7
commit 43d12a9647
2 changed files with 14 additions and 14 deletions

View File

@@ -148,10 +148,9 @@ class SingleTaskController extends AbstractController
*/
public function showAction(Request $request, $id)
{
/* @var $taskRepository SingleTaskRepository */
$taskRepository = $this->get('chill_task.single_task_repository');
$task = $taskRepository->find($id);
$em = $this->getDoctrine()->getManager();
$task = $em->getRepository(SingleTask::class)->find($id);
if (!is_null($task->getPerson() === !null)) {
$personId = $task->getPerson()->getId();
@@ -203,10 +202,9 @@ class SingleTaskController extends AbstractController
$id,
TranslatorInterface $translator
) {
/* @var $taskRepository SingleTaskRepository */
$taskRepository = $this->get('chill_task.single_task_repository');
$task = $taskRepository->find($id);
$em = $this->getDoctrine()->getManager();
$task = $em->getRepository(SingleTask::class)->find($id);
if (!is_null($task->getPerson() === !null)) {
$personId = $task->getPerson()->getId();
@@ -297,10 +295,9 @@ class SingleTaskController extends AbstractController
$id,
TranslatorInterface $translator
) {
/* @var $taskRepository SingleTaskRepository */
$taskRepository = $this->get('chill_task.single_task_repository');
$task = $taskRepository->find($id);
$em = $this->getDoctrine()->getManager();
$task = $em->getRepository(SingleTask::class)->find($id);
if (!$task) {
throw $this->createNotFoundException('Unable to find Task entity.');