Skip to content
Snippets Groups Projects
Select Git revision
  • 5d3b294a228c3c70fb65a2a1618323e16afc6fa2
  • master default protected
  • detached4
  • detached3
  • detached2
  • bsv-next
  • detached
  • php82
  • 6.x
  • 6.4.0
  • 6.3.3
  • 6.3.2
  • 6.3.1
  • 6.3.0
  • 6.2.7
  • 6.2.6
  • 6.2.5
  • 6.2.4
  • 6.2.3
  • 6.2.2
  • 6.2.1
  • 6.2.0
  • 6.1.3
  • 6.1.2
  • 6.1.1
  • 6.1.0
  • 6.0.0
27 results

AxiosModel.php

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    FormulaireControllerFactory.php 2.76 KiB
    <?php
    
    namespace UnicaenAutoform\Controller;
    
    use Psr\Container\ContainerExceptionInterface;
    use Psr\Container\ContainerInterface;
    use Psr\Container\NotFoundExceptionInterface;
    use UnicaenAutoform\Form\Categorie\CategorieForm;
    use UnicaenAutoform\Form\Champ\ChampForm;
    use UnicaenAutoform\Form\Formulaire\FormulaireForm;
    use UnicaenAutoform\Form\MotClef\MotClefForm;
    use UnicaenAutoform\Service\Categorie\CategorieService;
    use UnicaenAutoform\Service\Champ\ChampService;
    use UnicaenAutoform\Service\Formulaire\FormulaireInstanceService;
    use UnicaenAutoform\Service\Formulaire\FormulaireReponseService;
    use UnicaenAutoform\Service\Formulaire\FormulaireService;
    
    class FormulaireControllerFactory
    {
    
        /**
         * @param ContainerInterface $container
         * @return FormulaireController
         * @throws ContainerExceptionInterface
         * @throws NotFoundExceptionInterface
         */
        public function __invoke(ContainerInterface $container): FormulaireController
        {
            /**
             * @var CategorieService $categorieService
             * @var ChampService $champService
             * @var FormulaireService $formulaireService
             * @var FormulaireReponseService $formulaireReponseService
             * @var FormulaireInstanceService $formulaireInstanceService
             */
            $categorieService = $container->get(CategorieService::class);
            $champService = $container->get(ChampService::class);
            $formulaireService = $container->get(FormulaireService::class);
            $formulaireReponseService = $container->get(FormulaireReponseService::class);
            $formulaireInstanceService = $container->get(FormulaireInstanceService::class);
    
            /**
             * @var CategorieForm $categorieForm
             * @var ChampForm $champForm
             * @var FormulaireForm $formulaireForm
             * @var MotClefForm $motClefForm
             */
            $categorieForm = $container->get('FormElementManager')->get(CategorieForm::class);
            $champForm = $container->get('FormElementManager')->get(ChampForm::class);
            $formulaireForm = $container->get('FormElementManager')->get(FormulaireForm::class);
            $motClefForm = $container->get('FormElementManager')->get(MotClefForm::class);
    
            $controller = new FormulaireController();
            $controller->setCategorieService($categorieService);
            $controller->setChampService($champService);
            $controller->setFormulaireService($formulaireService);
            $controller->setFormulaireReponseService($formulaireReponseService);
            $controller->setFormulaireInstanceService($formulaireInstanceService);
            $controller->setCategorieForm($categorieForm);
            $controller->setChampForm($champForm);
            $controller->setFormulaireForm($formulaireForm);
            $controller->setMotClefForm($motClefForm);
            return $controller;
        }
    }