From: Al Newkirk Date: Sat, 6 Nov 2010 21:53:55 +0000 (-0700) Subject: explain how to use HashRefInflator with search X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e0fc76f11557b4cd58172aaabb3bb956b4282d3a;p=dbsrgits%2FDBIx-Class-Historic.git explain how to use HashRefInflator with search --- diff --git a/lib/DBIx/Class/ResultClass/HashRefInflator.pm b/lib/DBIx/Class/ResultClass/HashRefInflator.pm index 6d019ad..3c547c8 100644 --- a/lib/DBIx/Class/ResultClass/HashRefInflator.pm +++ b/lib/DBIx/Class/ResultClass/HashRefInflator.pm @@ -17,6 +17,16 @@ DBIx::Class::ResultClass::HashRefInflator - Get raw hashrefs from a resultset ... } + # when querying, the search method allows you to specify the result_class as a parameter + my $rs = $schema->resultset('CD')->search({}, + { + columns => [qw/.../], + result_class => 'DBIx::Class::ResultClass::HashRefInflator', + }); + while (my $hashref = $rs->next) { + ... + } + =head1 DESCRIPTION DBIx::Class is faster than older ORMs like Class::DBI but it still isn't