Commit ef356bda authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Petits bugs

parent 6e0bacf9
Loading
Loading
Loading
Loading
+1 −1
Changes for module/Application/src/Form/Intervenant/EditionForm.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -593,7 +593,7 @@ class EditionFormHydrator extends GenericHydrator
     *
     * @return array
     */
    public function extract($object)
    public function extract($object): array
    {
        $res = parent::extract($object);

+5 −4
Changes for module/Application/src/ORM/RouteEntitiesInjector.php: 5 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -25,10 +25,6 @@ class RouteEntitiesInjector
        $entityParams = $this->getCacheContainer()->entityParams('makeEntityParams');
        $params       = $e->getRouteMatch()->getParams();
        foreach ($params as $name => $value) {
            if (array_key_exists($name, $entityParams)) {
                $repo = $this->getEntityManager()->getRepository($entityParams[$name]);
                $e->setParam($name, $repo->find($value));
            } else {
            switch ($name) {
                case 'intervenant':
                    /** @var IntervenantService $serviceIntervenant */
@@ -50,7 +46,12 @@ class RouteEntitiesInjector
                    $repo = $this->getEntityManager()->getRepository(TypeAgrement::class);
                    $e->setParam('typeAgrement', $repo->findOneBy(['code' => $value]));
                break;
                default:
                    if (array_key_exists($name, $entityParams)) {
                        $repo = $this->getEntityManager()->getRepository($entityParams[$name]);
                        $e->setParam($name, $repo->find($value));
                    }
                break;
            }
        }
    }