requireRole($this->security, 'ROLE_GESTIONNAIRE'); $product = $this->products->find($productId); if (!$product) { $this->mcpError('not_found', "Product not found: {$productId}"); } $this->em->remove($product); $this->em->flush(); return $this->jsonResponse(['deleted' => true, 'id' => $productId]); } }