symfony-playground/src/Controller/IndexController.php

52 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
{
foreach ($repo->findByOfferId($request->query->get('offer_id')) as $sub) {
dump($sub);
}
return $this->render('index/notificationDm.html.twig');
}
2022-05-21 10:32:17 +00:00
}