apps/pdi/src/Controller/HomeController.php line 34
<?phpnamespace Pdi\Controller;use Doctrine\ORM\EntityManagerInterface;use Pdi\Repository\ActionPlanObjectifRepository;use Pdi\Service\ModuleActionPlanManager;use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;use Symfony\Component\HttpFoundation\Request;use Symfony\Component\HttpFoundation\Response;use Engine\Service\Interface\PdiInformationManagerInterface;use Symfony\Component\Routing\Annotation\Route;use Symfony\Component\Security\Http\Attribute\CurrentUser;use Symfony\Component\Serializer\Encoder\JsonEncoder;class HomeController extends AbstractController{private ActionPlanObjectifRepository $actionPlanObjectifRepository;private ModuleActionPlanManager $moduleActionPlanManager;public function __construct(ActionPlanObjectifRepository $actionPlanObjectifRepository, ModuleActionPlanManager $moduleActionPlanManager){$this->actionPlanObjectifRepository = $actionPlanObjectifRepository;$this->moduleActionPlanManager = $moduleActionPlanManager;}/*** @param Request $request* @return Response*/#[Route('/', name: 'user-homepage', methods: ['GET', 'POST'])]public function UserHomePage(Request $request): Response{//Get connected user$user = $this->getUser();$actionPlanObjectives = $this->actionPlanObjectifRepository->findBy(['userId' => $user, 'status' => 1]);$actionData = $this->moduleActionPlanManager->associatedAllTaskToAction($actionPlanObjectives, $user);return $this->render('@Pdi/page/home.html.twig',['currentTasks' => $actionData,]);}}