将默认值添加到doctrine yml映射上的manyToOne字段

时间:2014-07-24 07:05:13

标签: symfony doctrine-orm yaml

我需要知道如何在Symfony中的entity.orm.yml映射上为manyToOne字段添加默认值。此代码无效:

    manyToOne:
    usertype:
        targetEntity: Usertype
        cascade: {  }
        mappedBy: null
        inversedBy: null
        joinColumns:
            UserType:
                referencedColumnName: ID
        orphanRemoval: false
        options:
            default: 1

0 个答案:

没有答案