Re: Can a model belong to and habtm one model?

2008-12-15 Thread eagerterrier

Thanks Rafael and Jon,

I will give it a go.


TC

On Dec 12, 6:37 pm, "Jon Bennett"  wrote:
> Hieagerterrier,
>
> >  I have a facebook type app that I need to build for a client (don't we
> >  all?) and in it I have a model that ideally needs to be owned by one
> >  user, and also habtm other users (the owners friends)
>
> I'd say it was fine.
>
> Model > belongsTo < User
> Model > habtm < Friends (a different name for the habtm but also uses
> the 'user' model)
>
> but, are the other users always friends of the owner user? if so, can
> you not assume that they have access to all 'Model' that the owner
> has? then you wouldn't need the habtm at all! - just a thought.
>
> cheers,
>
> Jon
>
> --
>
> jon bennett
> w:http://www.jben.net/
> iChat (AIM): jbendotnet Skype: jon-bennett
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can a model belong to and habtm one model?

2008-12-12 Thread Jon Bennett

Hi eagerterrier,

>  I have a facebook type app that I need to build for a client (don't we
>  all?) and in it I have a model that ideally needs to be owned by one
>  user, and also habtm other users (the owners friends)

I'd say it was fine.

Model > belongsTo < User
Model > habtm < Friends (a different name for the habtm but also uses
the 'user' model)

but, are the other users always friends of the owner user? if so, can
you not assume that they have access to all 'Model' that the owner
has? then you wouldn't need the habtm at all! - just a thought.

cheers,

Jon


-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can a model belong to and habtm one model?

2008-12-12 Thread Rafael Bandeira aka rafaelbandeira3

yes you can, just assign different aliases like 'Owner' and
'OwnerFriends'

eagerterrier wrote:
> I have a facebook type app that I need to build for a client (don't we
> all?) and in it I have a model that ideally needs to be owned by one
> user, and also habtm other users (the owners friends)
>
> Before I go too far, I want to know if this approach is possible, or
> should I just stick another field in the habtm join table that is
> something along the lines of is_owner (boolean)
>
> Is this crossing the streams in Ghostbusters, or is it something very
> run of the mill that I just haven't done yet (8 cake sites under my
> belt and counting...)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Can a model belong to and habtm one model?

2008-12-12 Thread eagerterrier

I have a facebook type app that I need to build for a client (don't we
all?) and in it I have a model that ideally needs to be owned by one
user, and also habtm other users (the owners friends)

Before I go too far, I want to know if this approach is possible, or
should I just stick another field in the habtm join table that is
something along the lines of is_owner (boolean)

Is this crossing the streams in Ghostbusters, or is it something very
run of the mill that I just haven't done yet (8 cake sites under my
belt and counting...)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---