Thank you for your reply,

I don't want to get all of a user's votes. I want to join his votes to the
items listing. If he has 10000 votes and I'm listing 5 items, I would like
to join his possible 5 votes.



On Wed, Mar 5, 2008 at 12:13 PM, Lee Bolding <[EMAIL PROTECTED]> wrote:

>
> I'd look at a way of putting the functionality to get a users votes into
> the
> extended USER object, not the vote object. $user->getVotes() would be far
> cleaner IMO.
>
> You can probably make Symfony automatically work out the dirty work with a
> correctly configured schema.yml - maybe not on the user object itself (not
> entirely sure about that), but certainly on sfGuardUserProfile if you are
> using sfGuard ($user->getProfile()->getVotes(); or to get a vote item...
>
> $user->getProfile()->getVote($pk)->getItem();
>
> I extended ACLActions and made a preExecute method to always place the
> logged in users account and profile into the context (as $this->user and
> $this->profile) - makes things much easier :)
>
> -----Original Message-----
> From: [email protected] [mailto:
> [EMAIL PROTECTED]
> On Behalf Of Nicolas Perriault
> Sent: 05 March 2008 15:00
> To: [email protected]
> Subject: [symfony-users] Re: sfUser in Model
>
>
> On Wed, Mar 5, 2008 at 3:00 PM, Alex <[EMAIL PROTECTED]> wrote:
>
> > I have three models: votes, items, votes_items, and users.
>
> Hem, sounds like you should give a look to
> sfPropelActAsRatableBehaviorPlugin</advertisement> ^^
>
> > My question is: how do I access the sfUser object from within the model?
>
> sfContext::getInstance()->getUser()
>
> HTH
>
> ++
>
> --
> Nicolas Perriault
> http://prendreuncafe.com/blog
> GSM: 06.60.92.08.67
>
>
>
>
>
> >
>


-- 

- Alex

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to