requireRole($this->security, 'ROLE_GESTIONNAIRE'); $constructeur = $this->constructeurs->find($constructeurId); if (!$constructeur) { $this->mcpError('not_found', "Constructeur not found: {$constructeurId}"); } if (null !== $name) { $constructeur->setName($name); } if (null !== $email) { $constructeur->setEmail($email); } if (null !== $phone) { $constructeur->setPhone($phone); } $this->em->flush(); return $this->jsonResponse(['id' => $constructeur->getId(), 'name' => $constructeur->getName()]); } }