Doctrines - Circular Links

Is there a way to load fixtures with circular links? As an example, I have the following fixture:

BusinessEntityTeam:
  Nicole_Team:
    name: Nicole Team
    Manager: [Nicole]
    Business: [ACMEWidgets]

sfGuardUser
  Nicole:
    first_name:     Nicole
    last_name:      Jones
    email_address:  nicole@example.com
    username:       nicole
    password:       nicole
    Groups:         [Group_abc]
    Team:           [Nicole_Team]

As you can see, Nicole_Team refers to Nicole ... but Nicole also refers to Nicole_Team.

When the manager was not a required column, this was normal (the device was loaded, but the manager was NULL), but now it could not load the device.

The only thing I can see is to link the Team relationship in my own object (for example, “Profile”), so the relationship is no longer circular.

Is there any other approach? Each user must be on a team, but only a few users are team managers. I am completely open to the fact that my data model may be poorly designed and have room for improvement.

+5
1

:

BusinessEntityTeam:
  Nicole_Team:
    name: Nicole Team
    Business: [ACMEWidgets]

sfGuardUser
  Nicole:
    first_name:     Nicole
    last_name:      Jones
    email_address:  nicole@example.com
    username:       nicole
    password:       nicole
    Groups:         [Group_abc]
    Team:           [Nicole_Team]
    ManagerFor:     [Nicole_Team]

, .

+1

All Articles