Doctrine: Define many-to-many relation inline in fixture?

If you take a look at the schema. Yml file of sfDoctrineGuardPlugin you can see a refClass property on sfGuardUser relations: relations: Groups: ... refClass: sfGuardUserGroup It's a little tricky and not so well documented in Doctrine, but it seems to work.

Yes, aware of that. But my groups are loaded prior to the users (not in the same data:load task or transaction), so I need to refer to groups using static IDs. Thanks anyways – Prasad Apr 8 at 8:15 @Prasad I think I found the solution.At least it worked for me in some tests I did.

– elitalon Apr 8 at 9:31 thanks a ton! Hope based on your 1st reply, Groups: { name: Test Group} will also work – Prasad Apr 8 at 10:06 @Prasad Interesting... I cannot find an explanation on how it can link the objects using name but not the id.Is it me or Doctrine documentation is not completed with all these things? – elitalon Apr 8 at 10:30 @elitalon: not really.

It has an explanation. When you refer using Groups, it expects reference to a group or creation of an inline object. So Groups: GroupEditor and Groups: {name: GroupEditorName} both work.

In the latter, the object is defined inline, without a reference.So it cannot be referred in another model. – Prasad Apr 8 at 12:49.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions