Re: Constructing objects in multiple CDBI classes w. single SELECT

[prev] [thread] [next] [Date index for 2005/03/03]

From: Tony Bowden
Subject: Re: Constructing objects in multiple CDBI classes w. single SELECT
Date: 08:27 on 03 Mar 2005
On Wed, Mar 02, 2005 at 07:39:23PM -0500, Michael Graham wrote:
> > There is class data that will tell you this.  Look at the
> > Class::DBI::Relationship::* source code.
> Ah - thanks!  It looks like I can do this:
>     # HasMany
>     print "Artist __hasa_list: \n", Dumper(Music::Artist->__hasa_list), "\n";
>     print "CD     __hasa_list: \n", Dumper(Music::CD->__hasa_list),     "\n";
>     print "Track  __hasa_list: \n", Dumper(Music::Track->__hasa_list),  "\n";
>     # HasA
>     print "Artist __hasa_rels: \n", Dumper(Music::Artist->__hasa_rels), "\n";
>     print "CD     __hasa_rels: \n", Dumper(Music::CD->__hasa_rels),     "\n";
>     print "Track  __hasa_rels: \n", Dumper(Music::Track->__hasa_rels),  "\n";
> 

Those are deprecated methods that are disappearing real soon now.

You want Class->meta_info('has_a') and Class->meta_info('has_many'). 

Tony

Re: Constructing objects in multiple CDBI classes w. single SELECT
Tony Bowden 08:27 on 03 Mar 2005

Generated at 00:32 on 04 Mar 2005 by mariachi v0.52