symfony-playground/src/Controller/IndexController.php

51 lines
1.4 KiB
PHP
Raw Normal View History

2022-05-21 10:32:17 +00:00
<?php
namespace App\Controller;
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')]
public function notificationDm(Request $request, MerServiceRepository $repo): Response
{
2022-05-24 07:14:42 +00:00
dump('MerServiceRepository->findByOfferId');
dump($repo->findByOfferId($request->query->get('offer_id')));
2022-05-23 18:40:22 +00:00
return $this->render('index/notificationDm.html.twig');
}
2022-05-21 10:32:17 +00:00
}