But when using setPeerMethod() in various objects, will symfony allow me to
pass parameters?

On Wed, Mar 5, 2008 at 1:28 PM, Ian P. Christian <[EMAIL PROTECTED]>
wrote:

>
> Alex wrote:
> > Hello,
> >
> > I have three models: votes, items, votes_items, and users.
>
> ....                   ^ 1     ^ 2     ^ 3             ^... ? :D
>
> Anyway...
>
>
> If you want to do user specific code inside you model, you should pass
> an object that implements an interface to your Peer method IMO.
>
>  public static function doSelectJoinAllForUser(Criteria $c, IMyUser
> $user, $conn = null)
>   {
>     ...
>   }
>
> ....
>   interface IMyUser
>   {
>     public function getUserID();
>   }
> ....
>   class MyUser extends sfUser implements IMyUser
>   {
>     public function getUserId();
>   }
>
>
>
> It will help de-couple your model from the framework itself. Also, it
> means that this code it reusable for any other objects that implement
> the IMyUser interface, you could make your User model implement it for
> example...
>
>
> --
>
> Ian P. Christian ~ http://pookey.co.uk
>
> >
>


-- 

- 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