symfony-playground/src/Controller/IndexController.php

56 lines
1.6 KiB
PHP
Raw Normal View History

2022-05-21 10:32:17 +00:00
<?php
namespace App\Controller;
2022-05-24 08:06:04 +00:00
use App\Repository\MerBeDMRepository;
2022-05-23 18:40:22 +00:00
use App\Repository\MerBeSubRepository;
2022-05-23 13:22:36 +00:00
use App\Repository\MerParaSubRepository;
2022-05-23 18:40:22 +00:00
use App\Repository\MerServiceRepository;
2022-05-21 10:32:17 +00:00
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
2022-05-23 18:40:22 +00:00
use Symfony\Component\HttpFoundation\Request;
2022-05-21 10:32:17 +00:00
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use App\Repository\Entity1Repository;
class IndexController extends AbstractController
{
#[Route('/', name: 'app_index')]
2022-05-23 18:40:22 +00:00
public function index(
Entity1Repository $repo,
MerParaSubRepository $paraSubRepo,
MerBeSubRepository $beSubRepo
): Response
2022-05-21 10:32:17 +00:00
{
2022-05-23 13:53:20 +00:00
// repo dummy
2022-05-22 16:01:54 +00:00
$sm = $repo->getSchemaManager();
2022-05-21 10:32:17 +00:00
2022-05-23 18:40:22 +00:00
foreach ($paraSubRepo->findAll() as $sub) {
dump($sub);
}
dump('-------------------');
foreach ($beSubRepo->findAll() as $sub) {
dump($sub);
}
2022-05-23 13:22:36 +00:00
2022-05-21 10:32:17 +00:00
return $this->render('index/index.html.twig', [
2022-05-23 18:40:22 +00:00
'schemaManager' => $sm,
//'offer_id' => $sub->getService()->ge
2022-05-21 10:32:17 +00:00
]);
}
2022-05-23 18:40:22 +00:00
#[Route('/notification/dm', name: 'notification_dm')]
2022-05-24 08:06:04 +00:00
public function notificationDm(
Request $request,
MerServiceRepository $repo,
MerBeDMRepository $repoDm
): Response
2022-05-23 18:40:22 +00:00
{
2022-05-24 09:32:24 +00:00
return $this->render('index/notificationDm.html.twig', [
'serviceRepo' => $repo->findByOfferId($request->query->get('offer_id')),
2022-05-25 10:05:39 +00:00
//'beDmRepo' => $repoDm->findByOfferId($request->query->get('offer_id'))
2022-05-24 09:32:24 +00:00
]);
2022-05-23 18:40:22 +00:00
}
2022-05-21 10:32:17 +00:00
}