Don't ask to ask, just ask | |
PerlMonks |
Class::DBI::Iterator and overriding accessorsby HuckinFappy (Pilgrim) |
on Aug 08, 2006 at 18:58 UTC ( [id://566224]=perlquestion: print w/replies, xml ) | Need Help?? |
HuckinFappy has asked for the wisdom of the Perl Monks concerning the following question:
Knocking meekly on the gates the lowly monk creeps forward, hoping his brethren can help save his sanity.
We're learning about Class::DBI, and have mocked up some samples to see if it meets our needs. So far, it all seems excellent, but I've hit a snag I can't understand. The issue seems to be some interaction between many to many relationships and overriding the standard accessor names. In the base class that derives from Class::DBI (which all our other classes then derive from), we have the following: This makes all accessors and mutators follow our standard naming convention. So far, so good, it works as expected. Now we have a many to many relationship between classA and classB. This is done using a table tableClassAtoB. The problem comes when we do the following: When the next() is executed, we get the error: Due to how we've overriden the accessor name, it's clear to me that the method classB_id doesn't exist. We've used the Class::DBI functionality to change it to ClassB_Id(). But apparently Class::DBI::Iterator does not know that. What are we doing wrong? Do we need to subclass the Class::DBI::Iterator and create our own? Thanks Monks!
Back to
Seekers of Perl Wisdom
|
|