getCodes() as $code) { if ($reductionCart = $this->orderUtils->getReductionCartByCode($code)) { $this->addFlash('success', "Le code " . $code . " est déjà utilisé dans la réduction #" . $reductionCart->getId() . " " . $reductionCart->getTitle()); $displayError = true; } } if ($displayError == false) parent::updateEntity($entity); } /* public function persistProductFamilyEntity($entity, $newForm) { $entity = $this->productFamilyUtils->processBeforePersistProductFamily($entity, $newForm); $this->em->persist($entity); $this->em->flush(); }*/ }