Keep It Simple, Stupid | |
PerlMonks |
Add a method to a ResultSet Class in DBIx::Class?by matija (Priest) |
on Jan 09, 2008 at 11:47 UTC ( [id://661319]=perlquestion: print w/replies, xml ) | Need Help?? |
matija has asked for the wisdom of the Perl Monks concerning the following question: Oh glorious and incredibly patient fellow monks, can anybody please enlighten me how to add a method to a ResultSet class in DBIx::Class? Here is what I'm trying to do:
In other words, I'd like to find a way to put a method into the Article.pm file in such a way that I could access it by doing $schema->resultset('Article')->insert_article(...) I've tried directly declaring the class (as commented out, above) but it didn't work. Either I'm misunderstanding what the resulting class should be called, or I'm misunderstanding something else. I did read Re^2: [DBIX::Class] problem with Arbitrary SQL through a custom ResultSource, but it didn't help since the method I need contains a bunch of code (not all of which can be in SQL), and all of which should be done inside a transaction. I'd be grateful for any pointers...
Back to
Seekers of Perl Wisdom
|
|