Symfony 2 onDelete setNull

时间:2013-07-08 15:51:09

标签: symfony doctrine-orm yaml

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

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

感谢。

1 个答案:

答案 0 :(得分:8)

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

joinColumn:
    onDelete:  "SET NULL" 

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