requireRole($this->security, 'ROLE_GESTIONNAIRE'); $cfv = $this->em->getRepository(CustomFieldValue::class)->find($customFieldValueId); if (null === $cfv) { $this->mcpError('not_found', "CustomFieldValue not found: {$customFieldValueId}"); } $this->em->remove($cfv); $this->em->flush(); return $this->jsonResponse(['deleted' => true, 'id' => $customFieldValueId]); } }