[Dbix-class] role of result class?
Matt S Trout
dbix-class at trout.me.uk
Wed Mar 15 15:55:14 CET 2006
Michele Beltrame wrote:
> Hello!
>
> Upon further stduying I've come up to a solution, using ResultSetManager.
>
> -----
> package Aintra::M::Dbs::Schema::Calendar;
> use base 'DBIx::Class';
> use strict;
> use warnings;
>
> __PACKAGE__->load_components(qw/ ResultSetManager Core /);
> __PACKAGE__->table('calendar');
>
> sub mysearch : ResultSet {
> # Whatever
> }
> -----
>
> It DIDN'T work at the beginning because I used:
>
> -----
> __PACKAGE__->load_components(qw/ Core ResultSetManager /);
> -----
>
> That is to say: Core and ResultSetManager are specified in reverse
> order. It took me a while to track down the problem, so maybe this
> should be clearly written in the ResultSetManager documentation. ;-)
They aren't specified in reverse order, they're specified most specific base
class first, just like @ISA, use base and the rest of perl :)
--
Matt S Trout Offering custom development, consultancy and support
Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information
+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
More information about the Dbix-class
mailing list