Thanks Jon! I totally didn't even notice that.
I removed those brackets around the $rs, but I still seem to be getting this 
error:

Error: Can't locate object method "thumbnail"

When iterating through the resultset of a custom resultsource file, can you use
the columns as methods as you can with regular resultsource iterations?

Hope this makes sense.

Thanks again to Matt and Jonathon for their previous help on this thorny issue.

Cheers,

-ed

> From: [EMAIL PROTECTED]
> To: [email protected]
> Subject: Re: [Dbix-class] Complex query in custom resultsource file.
> Date: Tue, 12 Feb 2008 01:01:00 -0600
> 
> * On Tue, Feb 12 2008, edwrb . wrote:
> > Thanks Matt.  That 'as' trick took care of the SQL parsing issue.
> >
> > On a related note, is there a best practice for iterating through the
> > result-set from these
> > custom resource files by chance?  I thought something like the following 
> > would
> > work:
> >
> >   my $rs = [ $schema->resultset( 'MainRecordQuery' )->search( {},
> >     {
> >       bind  => [ $category, 'Y', 'thumbnail', 'main']
> >     }
> >   ) ];
> >
> > while (my $data = $rs->next) {
> >
> >     print $data->thumbnail . "\n";
> > }
> >
> > but it fails with the following error:
> >
> > 'Can't call method "next" on unblessed reference'  (from the while loop)
> 
> Well yeah, you've made $rs an array.  Omit the square brackets if you
> want a resultset instead of a reference to a list of row objects.
> 
> Regards,
> Jonathan Rockway
> 
> _______________________________________________
> 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/[EMAIL PROTECTED]

_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008
_______________________________________________
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/[EMAIL PROTECTED]

Reply via email to