Commit 1cd8163d authored by joriot221's avatar joriot221
Browse files

Passage de la verif code source du controller au save du service

parent aebe7f4e
Loading
Loading
Loading
Loading
−3
Changes for module/Application/src/Controller/PaysController.php: 0 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -42,9 +42,6 @@ class PaysController extends AbstractController
        }
        $form->bindRequestSave($pays, $this->getRequest(), function () use ($pays, $form) {
            try {
                if ($pays->getSourceCode() == null) {
                    $pays->setSourceCode($pays->getCode());
                }
                $this->getServicePays()->save($pays);
                $this->flashMessenger()->addSuccessMessage(
                    "Ajout réussi"
+11
Changes for module/Application/src/Service/PaysService.php: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -140,4 +140,15 @@ class PaysService extends AbstractEntityService

        return $qb;
    }



    public function save($entity)
    {
        if ($entity->getSourceCode() == null) {
            $entity->setSourceCode($entity->getCode());
        }

        return parent::save($entity);
    }
}
 No newline at end of file