Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Class::DBI: Filtering a many-to-many mapping does not work as advertised on CDBI manpage?

by unlinker (Monk)
on Nov 09, 2008 at 03:43 UTC ( #722451=note: print w/ replies, xml ) Need Help??


in reply to Re: Class::DBI: Filtering a many-to-many mapping does not work as advertised on CDBI manpage?
in thread Class::DBI: Filtering a many-to-many mapping does not work as advertised on CDBI manpage?

Thanks. The documentation says that the following generic template

A->has_many(bees => [AB => 'a'])
will call the method 'a' on each of the objects of type AB. This is exactly what I thought I should have got. I will check your suggestion (where did you see that syntax?) and report.
Thank you once again for the help


Comment on Re^2: Class::DBI: Filtering a many-to-many mapping does not work as advertised on CDBI manpage?
Download Code
Re^3: Class::DBI: Filtering a many-to-many mapping does not work as advertised on CDBI manpage?
by NetWallah (Abbot) on Nov 09, 2008 at 18:17 UTC
    The documentation for "has_many" reads:
    Class->has_many(method_to_create => "Foreign::Class");
    This method declares that another table is referencing us (i.e. storing our primary key in its table). It creates a named accessor method in our class which returns a list of all the matching Foreign::Class objects. In addition it creates another method which allows a new associated object to be constructed, taking care of the linking automatically. This method is the same as the accessor method with ``add_to_'' prepended.
    The syntax that you reference has this to say:
    Sometimes we don't want to return an instance of the Foreign::Class, but instead the result of calling a method on that object. We can do this by changing the Foreign::Class declaration to a listref of the Foreign::Class and the method to call on that class.
    Which I don't fully comprehend.

         Have you been high today? I see the nuns are gay! My brother yelled to me...I love you inside Ed - Benny Lava, by Buffalax

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://722451]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2014-09-30 21:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (384 votes), past polls