I'm working on my first Symfony project with Doctrine, and I've run into a hitch. I'm trying to express a game with two players. The relationship I want to have is PlayerOne and PlayerTwo each being keyed to an ID in the Users table. This is part of what I've got so far:
Game:
actAs: { Timestampable:- }
columns:
id: { type: integer, notnull: true, unique: true }
startDate: { type: timestamp, notnull: true }
playerOne: { type: integer, notnull: true }
playerTwo: { type: integer, notnull: true }
winner: { type: integer, notnull:true, default:0 }
relations:
User: { onUpdate: cascade, local: playerOne, foreign: id}
User: { onUpdate: cascade, local: playerTwo, foreign: id}
That doesn't work. It builds fine, but the SQL it generates only includes a constraint for playerTwo. I've tried a few other things:
User: { onUpdate: cascade, local: [playerOne, playerTwo], foreign: id}
Also:
User: [{ onUpdate: cascade, local: playerOne, foreign: id}, { onUpdate: cascade, local: playerTwo, foreign: id}]
Those last two throw errors when I try to build. Is there anyone out there who understands what I'm trying to do and can help me achieve it?