[Dbix-class] Problems getting prefetch to work..

Matt S Trout dbix-class at trout.me.uk
Sat Jun 24 19:45:47 CEST 2006

Tim Watson wrote:
> I think I was going about this a little reverse...
> This works...
>     my $rs = $dbh->resultset('User')->search({ 'sessionid' => '123456'
> } ,{ prefetch => 'user_session' });
> But I am unable to figure out how to access anything else in that
> session row... since I am returned a user object by $rs->next;
> I would like to be able to get a session obect and the user object
> from that one line..

You just did. Call $user->user_session to get the session object ...

      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