[Dbix-class] Ok, let's begin

Krzysztof Krzyzaniak eloy at kofeina.net
Tue Sep 20 23:45:11 CEST 2005


Bill Moseley wrote:
> On Tue, Sep 20, 2005 at 11:08:32PM +0200, Krzysztof Krzyzaniak wrote:
> 
>>>$rs->next will return an object
>>>$rs->all will return all objects in the resultset
>>>$rs->reset does what you expect
>>>$rs->count will count rows (via COUNT(*) without fetching data)
>>>$rs->delete deletes all records in the resultset
>>
>>
>>[% WHILE (record = records.next) %]
>>
>> ... do the Bartman
>>
>>[% END %]
> 
> 
> Is there much advantage of doing the above vs. this when the record
> set isn't too large (e.g. when displaying a page of items)?
> 
>     $c->stash->{records} = [ $rs->all ];

I think this should have advantage when results are cached. When results 
are not
cached it probably doesn't matter. But this demand some tests.

> Then
> 
>     [% FOREACH record = records %]
> 
> 
> 


-- 
-------e-l-o-y-----------e-l-o-y- at -t-r-a-n-s-i-l-v-a-n-i-a-.-e-u-.-o-r-g------

        jak to dobrze, że są oceany - bez nich byłoby jeszcze smutniej



More information about the Dbix-class mailing list