kernel = $kernel; $this->parameterBag = $parameterBag; $this->cacheManager = $cacheManager; $this->em = $entityManager; $this->requestStack = $requestStack; $this->router = $router; $this->translator = $translator; $this->translatorAdmin = $translatorAdmin; $this->merchantRepository = $merchantRepository; $this->sectionRepository = $sectionRepository; $this->formFactory = $formFactory; } public function getFunctions() { return array( new TwigFunction('carac_get_sections', [$this, 'getSections']), new TwigFunction('carac_get_form_switch_merchhant', [$this, 'getFormSwitchMerchant']), ); } public function getSections() { return $this->sectionRepository->findAll(); } public function getMerchants() { return $this->merchantRepository->findAll(); } public function getFormSwitchMerchant() { $form = $this->formFactory->create(SwitchMerchantFormType::class, null, ['action' => '#']); return $form->createView(); } }