Re: Cross between MightHave and HasMany?

[prev] [thread] [next] [Date index for 2004/11/06]

From: William McKee
Subject: Re: Cross between MightHave and HasMany?
Date: 03:34 on 06 Nov 2004
On Fri, Nov 05, 2004 at 09:06:01PM +0100, Jess Robinson wrote:
> Oops, oversaw this suggestion. I've not tried it, but it sounds like I'd  
> get the PersonCategory object, and not the Category object, when getting  
> that. It would be nice if has_a worked 'via' another table too, like  
> has_many does.

Yep, that's where Kingsley's suggestion to create a method that returns
the category may be a good option for you. However, if you have lots of
these type of relationships, that may be a problem (unless there is a
way to setup AUTOLOAD).


> Yup, isnt it all fun. Would be nice if there was a clear cut way to do  
> one-to-one relationships. I'd write a new C::B::Relationship class if I  
> could make any sense of them.

Actually that'd be a one-to-one-to-one relationship wouldn't it? Really
it's more like a 1:1 and a M:1 since you could have many categories in
the PersonCategory table. I suppose this is where object-oriented
databases start to look more appealing....

Good luck and let us know what you wind up doing.


Regards,
William

        -- 
        Knowmad Services Inc.
http://www.knowmad.com

(message missing)

Cross between MightHave and HasMany?
Jess Robinson 19:47 on 02 Nov 2004

Re: Cross between MightHave and HasMany?
Kingsley Kerce 20:08 on 02 Nov 2004

Re: Cross between MightHave and HasMany?
Jess Robinson 21:20 on 02 Nov 2004

Re: Cross between MightHave and HasMany?
Kingsley Kerce 21:35 on 02 Nov 2004

Re: Cross between MightHave and HasMany?
Jess Robinson 22:09 on 02 Nov 2004

Re: Cross between MightHave and HasMany?
Tony Bowden 23:43 on 02 Nov 2004

Re: Cross between MightHave and HasMany?
Peter Speltz 22:06 on 02 Nov 2004

Re: Cross between MightHave and HasMany?
Kingsley Kerce 22:39 on 02 Nov 2004

Re: Cross between MightHave and HasMany?
Jess Robinson 06:35 on 03 Nov 2004

Re: Cross between MightHave and HasMany?
William McKee 14:21 on 05 Nov 2004

Re: Cross between MightHave and HasMany?
Peter Speltz 14:36 on 05 Nov 2004

Re: Cross between MightHave and HasMany?
Jess Robinson 20:06 on 05 Nov 2004

Re: Cross between MightHave and HasMany?
William McKee 03:34 on 06 Nov 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52