“user_id”属性不会在配置中与“OneToOne”保持一致。这是yaml中的配置:
Event:
type: entity
table: events
repositoryClass: EventRepository
fields:
userId:
type: integer
unsigned: true
nullable: true
column: user_id
oneToOne:
user:
targetEntity: User
cascade: { }
mappedBy: null
inversedBy: null
joinColumns:
user_id:
referencedColumnName: id
orphanRemoval: false
在“OneToOne”和“fields”中描述“user_id”是否错误?阻止“user_id”保存的关系类型是否错误?