-
-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Labels
status:to be verifiedNeeds to be reproduced and validated.Needs to be reproduced and validated.type:bugBugBug
Description
No duplicates π₯².
- I have searched for a similar issue in our bug tracker and didn't find any solutions.
What happened?
I try to link the same class twice in another.
But the orm didn't let me do.
How can i do something like this :
#[Entity]
class Game extends AbstractModel
{
#[HasOne(target: User::class, innerKey: 'player_1_id', nullable: true, fkCreate: false, fkOnDelete: 'NO ACTION')]
private ?User $player1;
#[HasOne(target: User::class, innerKey: 'player_2_id', nullable: true, fkCreate: false, fkOnDelete: 'NO ACTION')]
private ?User $player2;
#[Entity(table: 'users')]
class User extends AbstractModel
{
#[hasOne(target: Game::class, innerKey: 'current_game_id', nullable: true, fkCreate: false, fkAction: 'NO ACTION')]
private ?Game $currentGame = null;A game have 2 user ( player_1 and player_2 ) , the user have a reference to the game...
but in the game class he can be the player 1 or the player 2 ...
Version
ORM 2.3.4
PHP 8.4Metadata
Metadata
Assignees
Labels
status:to be verifiedNeeds to be reproduced and validated.Needs to be reproduced and validated.type:bugBugBug
Type
Projects
Status
No status