[Catalyst] List/Scalar Context with TT + DBIC
Christopher H. Laco
claco at chrislaco.com
Wed May 31 21:00:39 CEST 2006
phaylon wrote:
> Mark Blythe said:
>> 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:
>
> IIRC there'll be a search_rs method (have a look at the ResultSet docs of
> the latest dev release of DBIC) that always returns a result set.
>
> hth, p
I just dealt with this last night converting the Handel TT plugins after
a conversion to DBIC. I had no problems using a resultset directly:
(Where items returns a resultset from schema->resultset->search)
FOREACH (item IN cart.items.all)
...
items = cart.items
WHILE (item = items.next)
..
I thought everything in TT was a scalar context, until you appended
.list to the end of it, assuming the item in question has no list() method.
How about some TT code?
-=Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060531/c27c25bf/attachment.pgp
More information about the Catalyst
mailing list