【发布时间】:2021-04-24 09:14:58
【问题描述】:
这可以显示一条消息而不是这个吗?
An exception occurred while executing 'DELETE FROM plan WHERE id = ?' with params [9]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`api`.`request`, CONSTRAINT `FK_3B978F9FE899029B` FOREIGN KEY (`plan_id`) REFERENCES `plan` (`id`))
我想通过一条消息“您不能删除它,因为它在其他地方使用过”来阻止删除
【问题讨论】:
-
这能回答你的问题吗? PHP try catch exceptions
标签: symfony doctrine api-platform.com