fixtures
This commit is contained in:
parent
1c542e3455
commit
7f97b7c5a9
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\Entity\MerParaSub;
|
|
||||||
use App\Repository\MerParaSubRepository;
|
use App\Repository\MerParaSubRepository;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
@ -15,8 +13,8 @@ class IndexController extends AbstractController
|
||||||
#[Route('/', name: 'app_index')]
|
#[Route('/', name: 'app_index')]
|
||||||
public function index(Entity1Repository $repo, MerParaSubRepository $subRepo): Response
|
public function index(Entity1Repository $repo, MerParaSubRepository $subRepo): Response
|
||||||
{
|
{
|
||||||
|
// repo dummy
|
||||||
$sm = $repo->getSchemaManager();
|
$sm = $repo->getSchemaManager();
|
||||||
$entity8 = $repo->findOneByName('entity 8');
|
|
||||||
|
|
||||||
$sub = $subRepo->findOne();
|
$sub = $subRepo->findOne();
|
||||||
dump($sub);
|
dump($sub);
|
||||||
|
@ -24,7 +22,6 @@ class IndexController extends AbstractController
|
||||||
|
|
||||||
return $this->render('index/index.html.twig', [
|
return $this->render('index/index.html.twig', [
|
||||||
'controller_name' => 'IndexController',
|
'controller_name' => 'IndexController',
|
||||||
'entity8' => $entity8,
|
|
||||||
'schemaManager' => $sm
|
'schemaManager' => $sm
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,10 @@ class MerFixtures extends Fixture
|
||||||
$sub->setService($tmp)->setRedCode('redcode1')->setSubDate(new \DateTimeImmutable('now'));
|
$sub->setService($tmp)->setRedCode('redcode1')->setSubDate(new \DateTimeImmutable('now'));
|
||||||
$manager->persist($sub);
|
$manager->persist($sub);
|
||||||
|
|
||||||
|
$sub = new MerParaSub();
|
||||||
|
$sub->setService($tmp)->setRedCode('redcode2')->setSubDate(new \DateTimeImmutable('now'));
|
||||||
|
$manager->persist($sub);
|
||||||
|
|
||||||
$manager->flush();
|
$manager->flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue