[Dbix-class] Create Components that operate on ResultSets

John Napiorkowski jjn1056 at yahoo.com
Fri Oct 20 20:07:59 CEST 2006


Hi,

I have a generic resultset class that is not at all
specific to a particular table.  I use it for getting
query parameters and filtering a resultset by page
number, max results and so forth.  Right now I load it
in each Schema that uses it like so:

__PACKAGE__->resultset_class('DBIx::Class::ResultSetByQuery');

But I'm trying to figure out a way to include it in
all my Schemas by default.  All my Schemas inherit
from a base.pm schema for loading components, but if I
put the __PACKAGE__->resultset_class in that I get the
following error:

Can't locate object method "result_source_instance"
via package "membership::Schema::base" at
/usr/lib/perl5/site_perl/5.8.5/DBIx/Class/ResultSourceProxy.pm
line 10.

I'd like to make this a more generic component since I
figure other people might be able to use it.  But I
can't find out how to make it a componant that loads
via __PACKAGE__->load_components().  I can't seem to
figure out how to create a resultset component.  Can
anyone point me toward a good example of this?  Seems
most of the components are oriented toward operating
on rows.

Do you think "ResultSetColumn.pm" would offer some
guidence as to the right way to do this?

Thanks for your advice,
John


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Dbix-class mailing list