Luke Saunders > DBIx-Class-0.08099_04 > DBIx::Class::ResultClass::HashRefInflator

Download:
DBIx-Class-0.08099_04.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  4
Stalled  5
View Bugs
Report a bug
Source   Latest Release: DBIx-Class-0.08114

NAME ^

DBIx::Class::ResultClass::HashRefInflator

SYNOPSIS ^

 my $rs = $schema->resultset('CD');

 $rs->result_class('DBIx::Class::ResultClass::HashRefInflator');

DESCRIPTION ^

DBIx::Class is not built for speed: it's built for convenience and ease of use. But sometimes you just need to get the data, and skip the fancy objects. That is what this class provides.

There are two ways of using this class.

METHODS ^

inflate_result

Inflates the result and prefetched data into a hash-ref using mk_hash.

mk_hash

This does all the work of inflating the (pre)fetched data.

CAVEAT ^

This will not work for relationships that have been prefetched. Consider the following:

 my $artist = $artitsts_rs->search({}, {prefetch => 'cds' })->first;

 my $cds = $artist->cds;
 $cds->result_class('DBIx::Class::ResultClass::HashRefInflator');
 my $first = $cds->first; 

$first will not be a hashref, it will be a normal CD row since HashRefInflator only affects resultsets at inflation time, and prefetch causes relations to be inflated when the master $artist row is inflated.