Interesting you should ask that, because I was just about to do the
same thing ;) However, when I tried linking another model to
sfGuardUser (a 1:n relationship, like "a user has many posts"), I got
a doctrine error when building the models (don't remember the wording
exactly, but the syntax error occurred exactly when adding the foreign
key to the table). I assumed the problem is that doctrine tries to
make a "reciprocal" relation between the models, thus attempting to
change the sfGuardUser model. Since it was just a simple test
application, I worked around the problem by relating the Post model to
the Profile model... but since it seems the best practice is to link
things directly to sfGuarUser, I'll probably run into this problem in
a real-life situation soon.

Did anyone experience the same situation? And if so, how could it be
"fixed" so I don't have to link all my stuff to the Profile class? :)

Thanks and kind regards,
Campezzi


On May 19, 9:01 pm, "David Ashwood" <da...@inspiredthinking.co.uk>
wrote:
> Use sfGuard as the root for all that need to reference the user.
> The profile is just one of them.  Keep it simple, keep it dry :)
>
> -----Original Message-----
> From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com]
>
> On Behalf Of halla
> Sent: 20 May 2009 01:41
> To: symfony users
> Subject: [symfony-users] Re: Best Practice for sfDoctrineGuardPlugin - how
> to tie other tables with user-related content?
>
> Hi David,
>
> I'm afraid your answer won't help me.
>
> > Checkout:http://www.symfony-project.org/plugins/sfDoctrineApplyPlugin
> > It's a profile plugin that's extendable with instructions on how to hook
> > itto sfDoctrineGuardPlugin
>
> This plugin demonstrate on how to extend a Guard-User with Profile
> Fields, using 1:1-related Table. This is what I also desribe in my
> posting (and what's also described in the Guard-Manual as well).
>
> What I want to know, is how OTHER tables have to be related to the
> User? Do I tie them directly to the Original sfGuardUser-Table using a
> 1:m relationship or do I tie them 1:m to my Profile-Table, which is
> tied again 1:1 to the sfGuardUser? (both described in my example)
>
> Hope, my problem is understandable so far... :-)
>
> Daniel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to