symfony-playground/src/Controller/IndexController.php

52 lines
1.4 KiB
PHP

<?php
namespace App\Controller;
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): Response
{
foreach ($repo->findByOfferId($request->query->get('offer_id')) as $sub) {
dump($sub);
}
return $this->render('index/notificationDm.html.twig');
}
}