[CDBI] meta_info and mapping tables

[prev] [thread] [next] [Date index for 2005/11/09]

From: Bill Moseley
Subject: [CDBI] meta_info and mapping tables
Date: 18:11 on 09 Nov 2005
With a link table "Role" that links films and actors

    Role->columns(Primary => qw/film actor/);
    Role->has_a(film => 'Film');
    Role->has_a(actor => 'Actor');


Then for File->meta_info('has_many', 'actor'):


    'actors' => bless( {
                         'foreign_class' => 'Role',
                         'name' => 'has_many',
                         'args' => {
                                     'mapping' => [
                                                    'actor'
                                                  ],
                                     'foreign_key' => 'film',
                                     'order_by' => undef
                                   },
                         'class' => 'Film',
                         'accessor' => 'actors'


Is the mapping array always a single element for normal link tables
(linking two tables)?

Or rather, when would the mapping array contain more than a single
element?





        -- 
        Bill Moseley
moseley@xxxx.xxx


_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] meta_info and mapping tables
Bill Moseley 18:11 on 09 Nov 2005

Re: [CDBI] meta_info and mapping tables
William Ross 18:28 on 09 Nov 2005

Re: [CDBI] meta_info and mapping tables
Matt S Trout 18:49 on 09 Nov 2005

Generated at 23:12 on 13 Nov 2005 by mariachi v0.52