Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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
Replies are listed 'Best First'.
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 pondering the Monastery: (11)
As of 2015-07-29 00:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls