2 DBIx::Class::ResultSet::HashRef - Adds syntactic sugar to skip the fancy
6 # in your resultsource class
7 __PACKAGE__->resultset_class( 'DBIx::Class::ResultSet::HashRef' );
10 my $rs = $schema->resultset('User')->search( { } )->hashref_rs;
11 while (my $row = $rs->next) {
15 You can chain up every L<DBIx::Class::ResultSet> method to ->hashref_rs:
17 * ->hashref_rs->all (same as ->hashref_array)
19 * ->hashref_rs->first (same as ->hashref_first)
22 This is a simple way to allow you to set result_class to
23 DBIx::Class::ResultClass::HashRefInflator to skip the fancy objects.
33 Sets result_class to DBIx::Class::ResultClass::HashRefInflator and
34 returns the resultset.
37 Calls ->hashref_rs->all and returns depending on the calling context an
38 array or an reference to an array.
40 my $rs = $schema->resultset('User')->search( { } )->hashref_array;
43 my @rs = $schema->resultset('User')->search( { } )->hashref_array;
47 Returns the first row of the resultset inflated by
48 DBIx::Class::ResultClass::HashRefInflator.
50 my $first_row = $schema->resultset('User')->search( { } )->hashref_first;
51 print Dumper $first_row
54 Johannes Plunien <plu@cpan.org>
57 Copyright 2008 by Johannes Plunien
59 This library is free software; you can redistribute it and/or modify it
60 under the same terms as Perl itself.
62 Thanks to mst for his patience.
66 * DBIx::Class::ResultClass::HashRefInflator