symfony-playground/src/Controller/IndexController.php

56 lines
1.6 KiB
PHP

<?php
namespace App\Controller;
use App\Repository\MerBeDMRepository;
use App\Repository\MerBeSubRepository;
use App\Repository\MerParaSubRepository;
use App\Repository\MerServiceRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use App\Repository\Entity1Repository;
class IndexController extends AbstractController
{
#[Route('/', name: 'app_index')]
public function index(
Entity1Repository $repo,
MerParaSubRepository $paraSubRepo,
MerBeSubRepository $beSubRepo
): Response
{
// repo dummy
$sm = $repo->getSchemaManager();
foreach ($paraSubRepo->findAll() as $sub) {
dump($sub);
}
dump('-------------------');
foreach ($beSubRepo->findAll() as $sub) {
dump($sub);
}
return $this->render('index/index.html.twig', [
'schemaManager' => $sm,
//'offer_id' => $sub->getService()->ge
]);
}
#[Route('/notification/dm', name: 'notification_dm')]
public function notificationDm(
Request $request,
MerServiceRepository $repo,
MerBeDMRepository $repoDm
): Response
{
return $this->render('index/notificationDm.html.twig', [
'serviceRepo' => $repo->findByOfferId($request->query->get('offer_id')),
'beDmRepo' => $repoDm->findByOfferId($request->query->get('offer_id'))
]);
}
}