From 7f97b7c5a93f7eed977a4337a74809dda5de3680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20=C3=81lvarez?= Date: Mon, 23 May 2022 15:53:20 +0200 Subject: [PATCH] fixtures --- src/Controller/IndexController.php | 5 +---- src/DataFixtures/MerFixtures.php | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Controller/IndexController.php b/src/Controller/IndexController.php index 0eb1cbf..f175a53 100644 --- a/src/Controller/IndexController.php +++ b/src/Controller/IndexController.php @@ -2,9 +2,7 @@ namespace App\Controller; -use App\Entity\MerParaSub; use App\Repository\MerParaSubRepository; -use Doctrine\ORM\EntityManager; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; @@ -15,8 +13,8 @@ class IndexController extends AbstractController #[Route('/', name: 'app_index')] public function index(Entity1Repository $repo, MerParaSubRepository $subRepo): Response { + // repo dummy $sm = $repo->getSchemaManager(); - $entity8 = $repo->findOneByName('entity 8'); $sub = $subRepo->findOne(); dump($sub); @@ -24,7 +22,6 @@ class IndexController extends AbstractController return $this->render('index/index.html.twig', [ 'controller_name' => 'IndexController', - 'entity8' => $entity8, 'schemaManager' => $sm ]); } diff --git a/src/DataFixtures/MerFixtures.php b/src/DataFixtures/MerFixtures.php index a85e58d..fd9fd20 100644 --- a/src/DataFixtures/MerFixtures.php +++ b/src/DataFixtures/MerFixtures.php @@ -37,6 +37,10 @@ class MerFixtures extends Fixture $sub->setService($tmp)->setRedCode('redcode1')->setSubDate(new \DateTimeImmutable('now')); $manager->persist($sub); + $sub = new MerParaSub(); + $sub->setService($tmp)->setRedCode('redcode2')->setSubDate(new \DateTimeImmutable('now')); + $manager->persist($sub); + $manager->flush(); } }