"user_id" property doesn't get persisted with "OneToOne" in config. Here is config in 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
Is it an error to describe "user_id" both in "OneToOne" and in "fields"? Can it be wrong relation type what prevents "user_id" from saving?
I shouldn't have tried to use both "user" and "user_id". Generally, never use relations, they give you nothing. There is no code generation. And to have Active Record one have to code it.