Geril
Geril

Reputation: 159

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.

Upvotes: 6

Views: 2306

Answers (1)

Nicolai Fröhlich
Nicolai Fröhlich

Reputation: 52493

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

Upvotes: 8

Related Questions