[Catalyst] List/Scalar Context with TT + DBIC

Nathaniel Nuss ogmoid at gmail.com
Thu Jun 1 08:19:05 CEST 2006


Could 'find()' be the 'search()' you're after?

--
Nate Nuss

On Wed, May 31, 2006 at 04:47:08PM +0000, Mark Blythe wrote:
> This isn't strictly a Catalyst question, but it involves the
> interaction of two commonly used Catalyst components: TT + DBIC.  I'm
> sure this must be an FAQ, but so far, RTFM and Googling have not
> revealed the answer.
> 
> How can I force scalar context from TT in order to get a DBIC
> ResultSet object back from search() rather than a list of rows?  For
> instance:
> 
> In TT template:
> 
> [% results = c.model('DB::Foo').search({ col => $value }) %]
> 
> This turns "results" into a list of records rather than an object I
> can call next(), first(), etc on.
> 
> I'll gladly RTFM if somebody can point me to the right FM.
> 
> Thanks.



More information about the Catalyst mailing list