<?php

namespace App\Controller\Frontend;


use App\Controller\AbstractController;
use App\Repository\Site\BlockStore;
use Doctrine\ORM\EntityManagerInterface;

class HomeController extends AbstractController
{
    protected BlockStore $blockStore;

    public function __construct(
        EntityManagerInterface $em,
        BlockStore $blockStore
    ) {
        $this->blockStore = $blockStore;
        parent::__construct($em);
    }

    public function home()
    {
        $blockCarto = $this->blockStore->getOneOnlineByDevAlias('home-carto');
        $blockPlanisphere = $this->blockStore->getOneOnlineByDevAlias('home-planisphere');
        $blockRessourcerie = $this->blockStore->getOneOnlineByDevAlias('home-ressourcerie');

        return $this->render('frontend/home.html.twig', [
            'blockCarto' => $blockCarto,
            'blockPlanisphere' => $blockPlanisphere,
            'blockRessourcerie' => $blockRessourcerie,
        ]);
    }
}