gpt4 book ai didi

Symfony 2 onDelete setNull

转载 作者:行者123 更新时间:2023-12-02 16:32:24 27 4
gpt4 key购买 nike

请有人告诉我如何在 Symfony 2 中设置 onDelete: SetNull ?这是示例:

oneToOne:
Company:
targetEntity: Company
inversedBy: id
joinColumn:
name: id
referencedColumnName: contact_person
onDelete: ??

谢谢。

最佳答案

只需引用字符串并将 onDelete 设置为 SET NULL,如下所示:

joinColumn:
onDelete: "SET NULL"

更多选项:http://www.doctrine-project.org/jira/browse/DDC-409

关于Symfony 2 onDelete setNull,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17530897/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com