<?php
namespace App\Controller;
use App\Entity\Export;
use App\Entity\Import;
use App\Service\Rosh\Logic\DashBoardLogic;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class MainController extends AbstractController
{
/**
* @Route("/", name="home_page", methods={"GET"})
* @param EntityManagerInterface $em
* @param DashBoardLogic $dashBoardLogic
* @return Response
*/
public function index(EntityManagerInterface $em, DashBoardLogic $dashBoardLogic): Response
{
return $this->render('index.html.twig', [
'chart' => [],
'exports' => $em->getRepository(Export::class)->findBy(
['type' => Export::TYPE_EXPORT_HOURS_STATEMENT],
['id' => 'DESC'], 15),
'imports' => $em->getRepository(Import::class)->findBy(
['type' => Import::TYPE_IMPORT_HOURS_STATEMENT],
['id' => 'DESC'], 15)
]);
}
}