Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony 2 onDelete setNull

please can someone tell me how can I set onDelete: SetNull in Symfony 2? Here is example:

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

Thanks.

like image 620
Geril Avatar asked Jul 08 '13 15:07

Geril


1 Answers

Just quote the string and set onDelete to SET NULL like this:

joinColumn:
    onDelete:  "SET NULL" 

more options: http://www.doctrine-project.org/jira/browse/DDC-409

like image 122
Nicolai Fröhlich Avatar answered Sep 16 '22 17:09

Nicolai Fröhlich