[Dbix-class] Having access to both resultset list AND resultsetmethods

Emily Heureux emily at burnham.org
Mon Apr 7 20:35:59 BST 2008


Thanks!  It works great now.

Emily

> -----Original Message-----
> From: Eden Cardim [mailto:edencardim at gmail.com]
> Sent: Monday, April 07, 2008 11:46 AM
> To: DBIx::Class user and developer list
> Subject: Re: [Dbix-class] Having access to both resultset list AND
> resultsetmethods
> 
> On Mon, Apr 7, 2008 at 2:33 PM, Emily Heureux <emily at burnham.org> wrote:
> > Hi, I have a resultset call like this in my Catalyst application:
> > $rs = [$c->model('DB::Table1)->search(
> >
> >             { .
> >
> >             },
> >
> >             { join => [ .]
> >
> >             }
> >
> >          )];
> > The reason for the brackets is, in my tt2 file, I can make a call
> directly
> > to the table column:
> >
> > [% FOREACH result IN rs %]
> >
> >    [% result.table1.column1 %]
> >
> > [% END %]
> >
> > and it works perfectly.
> 
> Don't stash an anonymous list, if you need the object list from the
> resultset just call:
> 
> [% FOREACH result IN rs.all %]
> 
> further reading: perldoc DBIx::Class::ResultSet
> 
> --
> edenc.vox.com
> 
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: http://www.grokbase.com/group/dbix-
> class at lists.rawmode.org





More information about the DBIx-Class mailing list